Jump to content

Newtonsoft.JSon.dll: How to update from 12.0.0 to 13.0.0 version?


Pascal
 Share

Recommended Posts

Hi Plastic SCM team,

I'm using Unity 2020.3.22f which include Plastic SCM components and its dependencies like Newtonsoft.Json, unfortunatly in my project I also use an other dll which need Newtonsoft.Json but a more recent one (13.0.0) as the Plastic SCM used (12.0.0).
It is possible to update the Newtonsoft.Json.dll include in Unity pakages from the version 12.0.0 to the 13.0.0?
Thanks for your help.


 

Link to comment
Share on other sites

Hi @Pascal,

The Version Control package has a Newtonsoft.dll that has been renamed to Unity.Plastic.Newtonsoft.Json.dll to avoid naming conflicts like this. Could you share screenshots of the errors you're seeing that show there's a conflict with the Netwonsoft.dll so that we can use them to further diagnose the issue? Could you also tell me if there's a specific Unity package or asset that is using v13.0.0 of the dll that is conflicting with the Version Control package?

Link to comment
Share on other sites

Hi Ryan,

I use Twitchlib for Unity an external tool which has a dependency with Newtonsoft.Json.dll .

As you can see on the screen shoots, in my Unity version (2020.3.22), the Newtonsoft Json lib is included by default to Unity as a package which is used by the Version Control package.

Thanks for your help.

Pascal

Image 002.png

Image 001.png

Link to comment
Share on other sites

Thank you for the added screenshots! I tried to reproduce the issue on my end (by adding the Newtonsoft Json 2.0.0 package with Version Control 1.13.5) but didn't experience any conflict errors. I've reached out to the dev team for more help.

I noticed in your Package Manager that you're able to see that Newtonsoft Json is depended on by Version Control, but I don't see that kind of dependency on my machines with the Newtonsoft package. Please share with me the manifest.json of your project (located in your project's Packages folder) as well as the manifest.json for 2020.3.22f1 in the following directory: 

For Windows: C:\Program Files\Unity\Hub\Editor\<your-version>\Editor\Data\Resources\PackageManager\Editor\manifest.json

For Mac: Applications/Unity/Hub/Editor/<your-version>/, Show Package Contents, Contents/Resources/PackageManager/Editor/manifest.json

Link to comment
Share on other sites

Thank you Ryan,

Here is the manifest.json file  from the C:\Program Files\Unity\Hub\Editor\2020.3.22f1\Editor\Data\Resources\PackageManager\Editor\manifest.json path.
I put also the archive found in the same directory which contains the Newtonsoft.Json.dll and a screenshot from the package manager about the Version Control dependencies.
 

Pascal

screenshot - version control dependencies.png

manifest.json com.unity.nuget.newtonsoft-json-2.0.0.tgz

Link to comment
Share on other sites

Thank you for supplying your manifest and package. I used the manifest to make a new 2020LTS project and added the Newtonsoft package you provided to that project, but I still don't get any conflicts between it and the Version Control package. I do see the Dependencies field for the Version Control package like what you shared previously, so I can confirm that it's using it (along with Services Core).

Could you also try sharing with me the Twitchlib package? Maybe there's another conflict in there that's the culprit of the errors?

Link to comment
Share on other sites

Hi Ryan,

The problem seams not to be in the entire Twichlib package, I can get the same error only when I put the Newtonsoft.Json.dll file in a new Unity project.
Try to load the package attached in a new Unity project using the Unity 2020.3.22f1 release, I hope than the issue will appear as in my project.

One more detail, I'm working on Windows 10.


If all working fine in your computer, can you share your configuration in term of software os and Unity version?

May be I should send my issue directly to the Unity team?

Thank for your help, regards.

Pascal

NewtonJsonTest-archive.unitypackage

Error snapshot.jpg

Link to comment
Share on other sites

Hi Pascal,

Adding the Newtonsoft.Json.dll to my project finally reproduces the issue for me, thank you for bearing with me.

So just to confirm, the DLL you provided was from the Twitchlib package you want to use. That DLL is a newer version of Newtonsoft, compared to the 2.0.0 version of the package in Unity, which is the one that the Version Control package depends on. And there's no way that Twitchlib can be used with just the Unity-provided Newtonsoft package, correct? That is why you'd like the Newtonsoft package that is currently used by the Version Control package to be updated to the more recent version.

Do I understand the situation properly now?

Link to comment
Share on other sites

Awesome, I'm glad we're on the same page!

Have you tried removing the Newtonsoft Json package from your Unity Project in the Package Manager to see if you still get any errors? You should be able to continue using the Version Control package using the dll supplied by the Twitch library package. I didn't encounter any errors in the Console or drop in functionality with the Version Control package when testing on my machine after removing Unity's Newtonsoft package.

Link to comment
Share on other sites

Hi Ryan,
The situation has changed, I updated my Unity version to the last release 2020.3.23f1 thinking the problem was solved but unfortunately the Newtown.Json package are no longer visible in the package manager but sill present in the folder /Library/PackageCache/com.unity.nuget.newtonsoft-json@2.0.0/Runtime/Newtonsoft.Json.dll.
My issue is still there, what can I do?

Screen 1.jpg

Screen 2.jpg

Link to comment
Share on other sites

Correct, that's the version of the Editor I was testing this bug with, which was why I was having trouble understanding where you were seeing the dependencies mentioned. It looks like later versions of Unity's Package Manager try to hide the dependent packages that aren't explicitly asked for by the user, but are needed by another package, to help declutter the UI. That's why the Newtonsoft package is missing in the Package Manager but is still located in the Library/PackageCache.

Sadly, my suggestion of removing Unity's Newtonsoft package won't work because the removed package will just be put right back by Unity as soon as it recompiles. That means that the only workaround options are either to make do with Unity's version of Newtonsoft, update the Unity Newtonsoft package, or uninstall the Version Control package. :(

The Newtonsoft package is not handled by the Version Control package team, but I can ask them to reach out to who is to see if we can request to have it be updated.

Can the Newtonsoft DLL that the Twitch library uses be easily removed from that library so that the Twitch components can be used with a version of the DLL in Unity instead? I didn't see the Newtonsoft DLL in the TwitchLib source code that I tried to build using Visual Studio (unless I'm blind), so I'm not sure if it's already embedded somewhere in the code somewhere or if it pulls the dependent DLL from elsewhere.

Link to comment
Share on other sites

Thank you Ryan for your hep to solve the issue.

About the Twichlib an the Newton.Json dll dependency you can find it in the TwitchLib.Api.core or TwitchLib.Api.Helix. So the Newton.Json dependency can't be removed witout a lot of efforts from me at each Twichlib update.

In my project I used the available Nuget's packages to build all required dlls it's easy and guaranty me to the compatibility with the Twich api.

I think it is not normal to provide a package with an hidden dependency from an open source popular public library which is not linked to the official depository, but the Unity one, causing a big issue and delaying the development of our game.

Hopping you can find the right guy in the right team to remove the issue, it's a big problem for my studio because our game in developement is a Twich based one.

Regards.

Pascal

picture 1.jpg

picture 2.jpg

Link to comment
Share on other sites

Of course, and thanks again for being so patient with me. I understand how frustrating it is to have your development blocked by your tools and want to fix this as quickly as possible.

I've reached out to the devs and they asked if you could double check if the conflict errors with the DLL are still present when the Version Control package is uninstalled. (You can do that by using the Remove button under Version Control in the Package Manager.)

I keep trying to reproduce this on my own machine, but I am just an utter failure with this library. I tried building the Twitch library with VS and pasted the built TwitchLib.Unity.dll into the Plugins folder of my test project, but instead of the Newtonsoft conflicts, I'm getting this error:

TwitchLibError.thumb.png.462e32c554ec913ecd007c76a3051316.png

Do you think you could send me a zipped Unity project with the Twitch library that reproduces the bug? That'll go a long way in finding a fix for this issue. Sorry again for asking you to do so much when you're struggling to get this to work.

In the meantime, if uninstalling the Version Control package does remove the errors and allows you to continue working, then you should still be able to use the Plastic SCM or Gluon clients outside of the Editor for pushing your changes and syncing with your team.

Link to comment
Share on other sites

Hi Ryan,

As you need, here is the archive file in attachment containing an empty project with all Unity Twitchlib's dll files.
I hope these files can help you, in the meantime, as you suggest, I'm going to remove the Version control package and use the external Plastic SCM client.
Thank again for your help. 

 

TwitchlibTest-project.unitypackage

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...