ChainSafe / web3.unity

🕹 Unity SDK for building games that interact with blockchains.
GNU Lesser General Public License v3.0
920 stars 235 forks source link

Multiple precompiled assemblies with same name #248

Closed AbdelNabut closed 1 year ago

AbdelNabut commented 1 year ago

Full errors:

1) Multiple precompiled assemblies with the same name BouncyCastle.Crypto.dll included on the current platform. Only one assembly with the same name is allowed per platform. (Slothtopia2021/Packages/io.moralis.web3-unity-sdk/Runtime/External/BouncyCastle.Crypto/BouncyCastle.Crypto.dll)

2) Multiple precompiled assemblies with the same name BouncyCastle.Crypto.dll included on the current platform. Only one assembly with the same name is allowed per platform. (Assets/Plugins/BouncyCastle.Crypto.dll)

This is when attempting to add Chainsafe to a project with Moralis, which I absolutely need for their AllERC721s function that works with Fantom.

KBryan commented 1 year ago

For this, you will need to remove one of the references. I'm under the impression that another dependency in your project has BouncyCastle.Crypto.dll already.

LiamVisionary commented 1 year ago

@KBryan Yep, Moralis has the same dll. But when I remove one of them, it causes numerous ambiguity errors like the one below:

Assets\Plugins\Nethereum\EthECKeys.cs(253,72): error CS0121: The call is ambiguous between the following methods or properties: 'Nethereum.RLP.ConvertorForRLPEncodingExtensions.ToIntFromRLPDecoded(byte[])' and 'Nethereum.RLP.ConvertorForRLPEncodingExtensions.ToIntFromRLPDecoded(byte[])'

It seems both Moralis and Chainsafe use the same library, but removing either from its respective framework causing tons of errors.

KBryan commented 1 year ago

Okay, I'm not too familiar with Moralis. It seems like you are trying to merge both SDKs. Our usage of Nethereum is minimal and takes specific parts. I'm not sure if Moralis is doing the same. So, your best bet is to create a new project and disable the importing of those libraries so that it doesn't clash together. What are you using from Moralis that ChainSafe doesn't have?

LiamVisionary commented 1 year ago

I could try that. I remember going through a huge headache of renaming functions, removing others ones, etc, in a previous project. But never got the chance to mention it.

If I could solely get by with Chainsafe, I'd love that. But unfortunately Chainsafe doesn't have an AllERC721s function to grab all the Fantom NFTs in a user's wallet. Moralis also have an expansive NFT api, including the ability to search and filter NFTs in the users wallet or from the entire chain. Also has cross chain functionality which makes loading NFTs in the same users wallet across different chains a breeze.

AbdelNabut commented 1 year ago

Seems Chainsafe and Moralis also have clashing DLLs (Web3GL). Wasn't a big issue in unity 2020, but 2021 seems more strict and is preventing WebGL builds

KBryan commented 1 year ago

We do not support using Moralis with ChainSafe Gaming SDK as its meant to be used independently. Closing this issue due to this.