Multiple Newtonsoft.Json.dll with Unity Analytics

I am getting the “multiple precompiled assemblies” error when adding the latest Unity Analytics Package through the library that clashes with the one added in the Backendless SDK.

I am using Unity 2021.3.0f1

To add the latest Unity Analytics package, in the package manager, press the + in the top left corner and add package by name… “com.unity.services.analytics”

I will try updating Unity to the latest 2021.3 version, but as newtonsoft is a dependency package for the analytics packages, i’m not sure of that will help.

Hi. I’ve created the inner task for deeper investigation [BKNDLSS-29047].
We will post here about the progress.

1 Like

Hello, @Joey_Fladderak.

Try to do this:

  1. Create a project and import the latest version of unitypackage there.
  2. There is some conflict between .dll newtonsoft.json from Backendless and Version Control. To solve this problem, I updated the Version Control to the latest version (WindowPackage Manager find the Version Control there and click the Update button).
  3. A whole lot of errors appear that indicate that the system libraries are not available. This is because newer versions use netstandard 2.0 by default. To fix this, go to EditProject SettingsPlayer(Tab) → Scroll down and choose API Compatibility Level to .NET 4.x.

Hi @Nikita_Fedorishchev

I don’t use the Version Control package. (It’s not added)

I get this issue due to adding the mentioned Analytics package. This package has a dependency on the Services Core package, which in turn has a dependency on the Newtonsoft Package.

Also the compatibility level is set correctly.

I have tried a couple of things:

  • Renaming the Backendless DLL, but it will still clash with duplicate symbols, so that is not an option.
  • I tried embedding the newtonsoft package as instructed here, but it seems the newtonsoft json dll included with backendless is a specific dependency for some of the other dlls and a different version, so it will just keep on spitting out errors.

Also, the reason that that upgrading the Version Control package to the latest version works, is because they have removed the dependency on the json package :slight_smile: So unless they also remove it as a dependency for the Unity Game Services, I don’t see this working.

Anyway, when reading the official responses from Unity in this thread it seems the only way to actually fix this, is to make the Unity version the version to use as a DLL.

I am not sure if you have other ways of getting this to work, but this might be a real pickle for the Unity users that want to use Backendless with other dependencies.

1 Like

Is there any indication of this, or when this is getting addressed?

I don’t want to sound pushy, but our launch is in about a month and this is currently blocking us from using either the Backendless .NET SDK or using Unity Analytics.

If this is going to take some time to fix (if at all) I will need to switch to the REST api for the time being, which I would rather do sooner than later. :slight_smile:

Hi, @Joey_Fladderak

I raised the priority of the ticket, our developer will take this task next. We can’t promise you anything at this time. But thank you for letting us know how important this task is to you. We have taken this into consideration and will do our best to resolve the issue in the nearest time.

Regards,
Marina

1 Like

Thanks for prioritizing this @Marina.Kan

I will keep monitoring this thread than. And if it is getting too close we will start using the REST api for the time being to be save.

We have everything working so far with the .NET SDK, so if it will be a close call to our deadline, we could still quickly switch back if needed.

Hello, @Joey_Fladderak.

By the way, I have a question. Don’t you have this library built-in into Unity?

Or have I misunderstood you and we are talking about different things?

Best Regards, Nikita.

Hi @Nikita_Fedorishchev

I have the built in one, but (as far as I know) that is the old version or perhaps some dependency. They have recently launched a new version of Analytics which relies on a new package.

I am not sure in which Unity version you can select it from the Unity Registry, but in 2021.3.0f1 I had to manually add it by pressing the ‘+’ sign in the top left corner and add the package by name: com.unity.services.analytics

I have an older version (2020.3.33f1). That’s probably why I can’t reproduce this error. Thanks, I’ll install a newer one

The new analytics package should be available from Unity 2019.4 so it shouldn’t be a problem.

Although I don’t know if a lower Unity version has a lower Analytics package version that might not have the dependency to the newtonsoft dependency.