Unity-QuickSheet icon indicating copy to clipboard operation
Unity-QuickSheet copied to clipboard

Newtonsoft.Json libraty reference update needed.

Open maxklimenok opened this issue 6 years ago • 9 comments

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!

maxklimenok avatar Feb 20 '20 11:02 maxklimenok

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

kimsama avatar Feb 25 '20 09:02 kimsama

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.

kxingking avatar Feb 25 '20 10:02 kxingking

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.

maxklimenok avatar Feb 25 '20 11:02 maxklimenok

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:

  • QuickSheet - 4.0.5.0
  • @markffrench's - 6.0.0.0
  • @kxingking's - 12.0.2.0

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 avatar Mar 28 '20 05:03 kimsama

Found some clues:

kimsama avatar Mar 28 '20 05:03 kimsama

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

Personuo avatar Sep 14 '20 18:09 Personuo

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.

kimsama avatar Sep 15 '20 08:09 kimsama

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

Personuo avatar Sep 16 '20 10:09 Personuo

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

kxingking avatar Aug 02 '21 08:08 kxingking