Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newtonsoft.Json libraty reference update needed. #77

Open
maxklimenok opened this issue Feb 20, 2020 · 9 comments
Open

Newtonsoft.Json libraty reference update needed. #77

maxklimenok opened this issue Feb 20, 2020 · 9 comments

Comments

@maxklimenok
Copy link

I have just updated my project to Unity 2020.1.0a23 and have got the following error:

Assembly 'Assets/Plugins/QuickSheet/GDataPlugin/Editor/Google/Google.GData.Client.dll' will not be loaded due to errors:
Google.GData.Client references strong named Newtonsoft.Json, versions has to match. Assembly references: 4.0.5.0 Found in project: 6.0.0.0.

So it seams that the reference and/or an assembly has to be updated in the source code to a newer version.
And thanks for the great asset!

@kimsama
Copy link
Owner

kimsama commented Feb 25, 2020

Would you see the #78? @kxingking looks like resolved the issue. And please, let me know if it resolves your issue. Thanks in advance.

@kxingking
Copy link

Sorry for my bad descrption,I haven't resolve this issue. After I upgrade the Newtonsoft.json version to 2.0.0-preview manually in manifest.json and delete the Newtonsoft.json.dll in the project, the errors in Editor console disappered. But when I press this "Finish Authentication" button, the error still showed:

Could not load file or assembly "Newtonsoft.json,version =4.0.5.0,Culture=neutral,PublickKeyToken=30ad4fe6baeed" or one of its dependcies"

It seems the scripts can find the newer dll in \Library\PackageCache\ folder but the dlls in GDataPlugin\Editor\Google\ folder still depend on the old Newtonsoft.json dll.

so any suggestions?
thx.

@maxklimenok
Copy link
Author

Hi @kimsama !
@kxingking have not actually resolved the issue, but pushed the issue to the point where I have ended up struggling with it. ) In a few words we have a classic dependency hell issue.

So to recap:
Your awesome plugin relies on external (precompiled (*.dll) libraries) like newtonsoft serializer version 4.0.5.0 and Google.GData (located at ...Assets\Plugins\QuickSheet\GDataPlugin\Editor\Google ).

Unity on its side has:
a). Builtin serializer, originating from newtonsoft library and shrieked to the most basic functions, ( https://docs.unity3d.com/2020.1/Documentation/Manual/com.unity.modules.jsonserialize.html) and recognized as version 6.0.0.0 as in my error above.
b). Optional full newtonsoft library provided as stand alone package downloadable through package manager (https://docs.unity3d.com/2020.1/Documentation/Manual/com.unity.nuget.newtonsoft-json.html). It is recognized as version 12.0.2.0 (@kxingking problem)

Unity now does not allow to have several libraries to be loaded in the same namespace, namely: using Newtonsoft.Json; loads the version with the latest version number.

So the root of the problem that Google.GData library "strongly" relies on / references version 4.0.5.0 which could not be loaded, because the newer version of the library is present in the system.

So it seams to me, that to resolve the issue a newer version of Google.GData has to be supplied with the plugin without "strong naming" for the Newtonsoft library.

@kimsama
Copy link
Owner

kimsama commented Mar 28, 2020

First thing first, thank you for the detailed answer and sorry for the late replay.
With my understanding, it's a version difference issue.
The version of NewtonJson:

So the root of the problem that Google.GData library "strongly" relies on / references version 4.0.5.0 which could not be loaded, because the newer version of the library is present in the system.

Is that clear? I have no ideas on Google.GData is strongly bound to Newtonsoft.Json. The newer version of Newtonsoft.json is available on here but it sounds like the newer version of Google.GData should be applied to resolve that. Google.GData SDK can be downloaded on here and its latest version is 2.2.0.0. But even the latest version of GData uses 4.0.5.1 version of Newtonsoft.json.
Did anyone try to replace Newtonsoft.json.dll as the latest version??

UPDATE:
understood. It looks like @kxingking already tried that.

@kimsama
Copy link
Owner

kimsama commented Mar 28, 2020

Found some clues:

@Personuo
Copy link

omg, when I upgraded my project to 2020, this tool doesn't work!

@kimsama
Copy link
Owner

kimsama commented Sep 15, 2020

omg, when I upgraded my project to 2020, this tool doesn't work!

Sorry for the inconvenience. It's a known issue and looks like it might need the update of Google SDK.

@Personuo
Copy link

omg, when I upgraded my project to 2020, this tool doesn't work!

Sorry for the inconvenience. It's a known issue and looks like it might need the update of Google SDK.

It's really need gdata?
I found a tool named dataBox in unity asset store, it's can download sheet file,but not used gdata

@kxingking
Copy link

kxingking commented Aug 2, 2021

Solved
0 delete 'Assets/QuickSheet/GDataPlugin/Editor/Google/Newtonsoft.Json.dll'
1 uncheck 'Assembly Version Validation' in ProjectSetting/Player/OtherSettings

Sorry to answer so late.

@kimsama @maxklimenok @Personuo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants