allartprotocol / unity-solana-wallet

The First Open-Source Unity-Solana Wallet with NFT support
282 stars 128 forks source link

Newtonsoft.Json.dll compilation errors during package import #19

Closed hashx101 closed 2 years ago

hashx101 commented 2 years ago

I got this error when I imported the package.json file through package manager.

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.

I tried to rename the file from the project directory (Library/PackageCache/com.unity.nuget.newtonsoft-json@2.0.0/Runtime/Newtonsoft.Json.dll) - wouldn't work, compilation failed and it rebuilt itself with the original name.

Tried to rename the file in this package (unity-solana-wallet/Runtime/Plugins/Newtonsoft.Json.dll) - showed the import in the package manager but got another compilation error: C:\Users\crypt\Developer\unity-solana-wallet\Runtime\codebase\utility\ObjectToByte.cs(101,38): error CS0433: The type 'JToken' exists in both 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' and 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=null'

Any idea how to resolve this please? Thanks

andersonliam35 commented 2 years ago

So as far as I found, when I renamed/removed the Newtonsoft.Json file OUTSIDE the unity project (I cant remember which one) I arrived at an error "Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'". once I got to this error, I enabled NET 4.x compatibility by going to Edit > Project Settings > Player and then finding the 'Configuration' section where Api Compatibility Level* is.

Hope this helps!