UnityNuGet icon indicating copy to clipboard operation
UnityNuGet copied to clipboard

Newtonsoft JSON conflict with Unity's internal version

Open mikeskydev opened this issue 3 years ago • 2 comments

Hi,

I'm working on a project that uses Google APIs Core Client Library, that defines Newtonsoft JSON as a dependency from this registry, which is therefore installed automatically.

However, I've gone to add Unity's Localization package, which depends on Unity's internal Newtonsoft JSON. Therefore, I can't add it. Annoyingly they're the exact same version, but just from different places.

I figure there may be a lot of situations where Unity's internal version will conflict with this registry's version, is there a way forward that could resolve these conflicts nicely without having to resort to not using this registry for packages, perhaps defining the dependency on Unity's version instead?

mikeskydev avatar Aug 08 '22 14:08 mikeskydev

That is a known problem https://issuetracker.unity3d.com/issues/localization-package-duplicates-json-dependency

KuraiAndras avatar Aug 11 '22 12:08 KuraiAndras

I'm not sure I understand why it's a problem specific to the localization package, shouldn't Unity get to depend on it's own first-party packages? If anything I don't want to use the Nuget version of Newtonsoft, I'd rather depend on Unity's version as it's used elsewhere.

mikeskydev avatar Aug 11 '22 12:08 mikeskydev

Solved this for me by making my own version of the core package and swapping out which newtonsoft dependency it needed

mikeskydev avatar Nov 17 '22 11:11 mikeskydev

Closing, it is a known problem that requires manual intervention to resolve the conflict as explained at: https://github.com/xoofx/UnityNuGet/issues/125#issuecomment-1211937842.

bdovaz avatar Sep 13 '23 06:09 bdovaz