Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error after adding Unity Collections package #76

Closed
yuchenz27 opened this issue Mar 3, 2022 · 15 comments
Closed

Compile error after adding Unity Collections package #76

yuchenz27 opened this issue Mar 3, 2022 · 15 comments
Labels
wontfix This will not be worked on

Comments

@yuchenz27
Copy link

yuchenz27 commented Mar 3, 2022

After adding Unity Collections pakcage, I got this error

Library/PackageCache/com.unity.collections@1.1.0/Unity.Collections/xxHash3.cs(560,27): error CS0234: The type or namespace name 'umul128' does not exist in the namespace 'Common' (are you missing an assembly reference?)
Library/PackageCache/com.unity.collections@1.1.0/Unity.Collections/xxHash3.cs(582,27): error CS0234: The type or namespace name 'umul128' does not exist in the namespace 'Common' (are you missing an assembly reference?)
Library/PackageCache/com.unity.collections@1.1.0/Unity.Collections/xxHash3.cs(589,28): error CS0234: The type or namespace name 'umul128' does not exist in the namespace 'Common' (are you missing an assembly reference?)
Library/PackageCache/com.unity.collections@1.1.0/Unity.Collections/xxHash3.cs(825,22): error CS0234: The type or namespace name 'umul128' does not exist in the namespace 'Common' (are you missing an assembly reference?)

My platform is iOS.

The second answer of this link explains how to add Unity Collections pakcage

https://forum.unity.com/threads/how-do-i-add-the-collections-package.1138399/

image

Does anyone know how to fix this? Thank you.

@supiket
Copy link

supiket commented Mar 3, 2022

Facing the same issue on Android target.

@0xPr0f
Copy link

0xPr0f commented Mar 3, 2022

hey, can you guys drop steps to reproduce ?

@yuchenz27
Copy link
Author

yuchenz27 commented Mar 3, 2022

@0xPr0f sure.

  1. Create a new unity project and import moralis boilerplate unitypackage
  2. Add com.unity.collections package

I am using Unity2021.2.12 on mac

@supiket
Copy link

supiket commented Mar 3, 2022

I solved the issue in the following way:

  1. Moved the com.unity.collections@<your_version> folder from <YourProjectRoot>/Library/PackageCache/ directory to <YourProjectRoot>/Packages/ directory.
  2. Opened the file com.unity.collections@<your_version>/Unity.Collections/xxHash3.cs.
  3. Changed the Common.umul128(...) calls to Unity.Burst.Intrinsics.Common.umul128(...) calls.

The reason for step 1 is that the Library directory is "volatile", so when I edit the script without applying step 1, step 3 was undone with each Unity recompile.

@supiket
Copy link

supiket commented Mar 3, 2022

Also, I'm using Unity 2020.3.22f1 (LTS) on Windows.
I believe doing this would require manual updating of the Collections package from this point on. Sadly I will go with this, since I haven't been able to find another solution for days now.

@xactant
Copy link
Contributor

xactant commented Mar 3, 2022

@yuchenz27 and @supiket is this a conflict with the Moralis / Unity SDK - re-reading your comments above, it is not apparent that it is. Are you seeing something not reflected in your comments? Thanks.

@supiket
Copy link

supiket commented Mar 3, 2022

I believe the problem is with Common.Logging and/or Common.Logging.Core dll files. There is somehow a conflict of the namespace Common between these dll files and Unity.Burst.Intrinsics.Common, which is called in the Collections script xxHash3.cs.

@yuchenz27
Copy link
Author

yuchenz27 commented Mar 3, 2022

@xactant I think there is a naming conflict between Unity.Burst.Intrinsics.Common and these dlls in moralis folder:

image

It is fine to use either of Moralis SDK or Unity Collections package. Those errors appeared if they were used together.

@supiket
Copy link

supiket commented Mar 3, 2022

Also for reference, a similar issue was opened for Nethereum.

@0xPr0f
Copy link

0xPr0f commented Mar 3, 2022

this is conflict between two packages with the same name

@yuchenz27
Copy link
Author

yuchenz27 commented Mar 3, 2022

@supiket I think your solution is probably the only quick way to fix that unless Unity upgrades the Collections package or they stop using those Common.Logging dlls.

@xactant
Copy link
Contributor

xactant commented Mar 8, 2022

Looking through the code, the Common.Logging.DLL is included due to Nethereum. As this is a conflict between two 3RD party packages and not with the Moralis SDK, I am not going to take action on this issue at this time.

Changing status to "wontfix" for now.

@xactant xactant added the wontfix This will not be worked on label Mar 8, 2022
@emandiev
Copy link

The steps suggested by @supiket worked for me as well:

I solved the issue in the following way:

  1. Moved the com.unity.collections@<your_version> folder from <YourProjectRoot>/Library/PackageCache/ directory to <YourProjectRoot>/Packages/ directory.
  2. Opened the file com.unity.collections@<your_version>/Unity.Collections/xxHash3.cs.
  3. Changed the Common.umul128(...) calls to Unity.Burst.Intrinsics.Common.umul128(...) calls.

@KoenRijpstra KoenRijpstra mentioned this issue May 20, 2022
@KoenRijpstra
Copy link
Contributor

This problem is fixed version 1.2.0! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

7 participants
@KoenRijpstra @emandiev @xactant @supiket @yuchenz27 @0xPr0f and others