Vytek / AlgorandUnity

Unity example using Algorand .NET SDK
MIT License
8 stars 2 forks source link

On linux, in Unity, I see Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included #32 #2

Open tomachinz opened 2 years ago

tomachinz commented 2 years ago

Opening the project up after cloning from github in Unity 2020.3.18f1 I initially realised I need to put the Algorand SDK on with

nuget install Algorand

and pulling in fresh packages in package manager, moving to the Unity console I see:

Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included or the current platform. Only one assembly with the same name is allowed per platform. (Assets/Plugins/Newtonsoft.Json.dll)
Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included or the current platform. Only one assembly with the same name is allowed per platform. (/home/tom/Github/AlgorandUnity/Library/PackageCache/com.unity.nuget.newtonsoft-json@2.0.0/Runtime/Newtonsoft.Json.dll)

Using the tool F-Search I see I have no less than the auspicious 69 copies of this file spread about the various drives. I'd include some but am having issues with the text file with the list right now.

Any ideas? Zorin OS 16 Linux 5.11.0-38-generic #42~20.04.1-Ubuntu SMP

Vytek commented 2 years ago

Hello, you don't need to install algorand sdk with nuget. All used assembly libraries are in Plugins directory under your Assets in Unity project. I insert all in the repo so if you clone it you must have it in your Unity Project. Please let me know. See you.

tomachinz commented 2 years ago

Right yes, I wonder if I should issue a nuget remove yeah? This would be a namespace collision technically yeah? Thanks by the way for your timely response. I guess I will give that a try now and report back... I can't recall what my working directory was when I did the nuget install - would that matter? I'll issue a remove from /home/tom/Github/AlgorandUnity folder now.

So I did this:

nuget delete Algorand
delete: invalid arguments.
usage: NuGet delete <package Id> <package version> [API Key] [options]

Deletes a package from the server.

Perhaps I will wipe folder and do another pull from github...

tomachinz commented 2 years ago

Perhaps it's the 2 versions I've been trying to open this in (Unity 2020.3.18f and 2021), but in both it opens straight to a bunch of errors about the Collaborate Pack (did I add this or you? I didn't add it to your project but it seems to be there) and also Animation from timeline. First error from each chunk is:

Library/PackageCache/com.unity.collab-proxy@1.9.0/Editor/Collaborate/Models/Providers/Collab.cs(68,9): error CS8356: Predefined type 'System.ValueTuple`2' is declared in multiple referenced assemblies: 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
Library/PackageCache/com.unity.timeline@1.5.6/Editor/Animation/BindingTreeViewDataSource.cs(197,37): error CS0433: The type '(T1, T2)' exists in both 'System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

Looking about the place, I can see Library is correctly not included and is getting built from your manifest.json

Not sure about ValueTuple I assume this is a function that returns two values - maybe like a vec2 perhaps.

Perhaps it relates to version numbers: one is 4.0.0.0 and one is 4.0.2.0? I'm a bit lost I admit.

Should I try open with Unity 2019?

Vytek commented 2 years ago

In this example I use Unity 3D Version 2019.4.14f1 Personal Edition. But you can recreate all assembly in Plugins using what I describe in this post:

https://developer.algorand.org/solutions/simple-example-using-algorand-with-unity-3d-engine/

Check: How to install Algorand .NET DLL in Unity And the note: The last very important step is to copy all the contents of the directory (except of course the executable .exe created) in a special folder created in the Unity project with the name “Plugins”