Open Runaway01 opened 1 year ago
I'm having the same issue where Yarn 2.3.1 dll collides with the one in the NUGET package, NUGET adds the dll as a dependency which causes the problem.
I agree with @Runaway01 that if Yarn also added this dll as a dependency it would not have this issue.
Multiple precompiled assemblies with the same name System.Runtime.CompilerServices.Unsafe.dll included on the current platform. Only one assembly with the same name is allowed per platform. (.../Library/PackageCache/org.nuget.system.runtime.compilerservices.unsafe@4.5.3/System.Runtime.CompilerServices.Unsafe.dll)
Sadly this continue to happen with the new version 2.4.0
This is something we've been trying to work out the best way to fix. The issue is because we ship DLLs and we need to do this because we distribute Yarn Spinner outside of OpenUPM. In OpenUPM we could just go "hey we have dependancies on X" and let it handle it, but for everyone else the opposite issue now arises of "hey I don't have a DLL, what gives?"
So some solutions we've been thinking about:
None of these is ideal, hence why we are sorta stuck. For now the terrible quick hack of deleting the conflicting DLLs from the YS package on disk should solve the issue but it isn't the long term solution.
Ah I understand the problem now.
What I've done as a workaround is to replace Yarn Spinner Package Manager integration by downloading the package from github and adding it directly. This way I can safely remove any dll that may cause conflicts.
This is something we've been trying to work out the best way to fix. The issue is because we ship DLLs and we need to do this because we distribute Yarn Spinner outside of OpenUPM. In OpenUPM we could just go "hey we have dependancies on X" and let it handle it, but for everyone else the opposite issue now arises of "hey I don't have a DLL, what gives?"
So some solutions we've been thinking about:
- Make OpenUPM the only way to install YS
- Use an IL repacker to rename, merge, and hide the DLLs we need
- Tell people to just delete the conflicting DLLs
Make two versions of YS:
- OpenUPM one wouldn't have the DLLs and have the dependency
- Non-OpenUPM one would have the DLLs
- both would be the same code and likely be done via a commit hook
None of these is ideal, hence why we are sorta stuck. For now the terrible quick hack of deleting the conflicting DLLs from the YS package on disk should solve the issue but it isn't the long term solution.
Thanks for the info. To sort this, we added the package manually and deleted the conflicting DLLs.
Edit: I didn't mean to close the issue, sorry 😅
Could the dependencies be defined via package.json, then resolved and embedded when creating the .unity package as a build step or something like that?
Edit: I didn't mean to close the issue, sorry 😅
Ah the number of times I have closed issues by accident are too high to count...
What is the current behavior? When having both Yarn Spinner and Type References in the same project the following error prevents building to any platform:
Plugin 'System.Runtime.CompilerServices.Unsafe.dll' is used from several locations
.Please provide the steps to reproduce, and if possible a minimal demo of the problem:
openupm install com.solidalloy.type-references
.Here's a project with this already set up which just needs to be built to produce the error.
What is the expected behavior? The build completes without error.
Please tell us about your environment:
Other information I think if YarnSpinner had these DLLs as dependencies rather than shipping them this would not be an issue.
Here's the full error:
Thanks for your time.