Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  DllNotFoundException after migrating 2020 Win to 2021 Mac
#1
Hi,

I tried to keep the subject short. I migrated my project from Unity 2020 LTS on a Windows 10 Laptop to Unity 2021.2.1f1 on a M1 Mac.

It actually went way better than I though but when I enter play mode I get these type of errors spammed with different call stacks. Here are two examples:

Code:
DllNotFoundException: libOni assembly:<unknown assembly> type:<unknown type> member:(null)
Obi.OniBackend.CreateSolver (Obi.ObiSolver solver, System.Int32 capacity) (at Assets/Obi/Scripts/Common/Backends/Oni/OniBackend.cs:17)
Obi.ObiSolver.Initialize () (at Assets/Obi/Scripts/Common/Solver/ObiSolver.cs:862)
Obi.ObiSolver.AddActor (Obi.ObiActor actor) (at Assets/Obi/Scripts/Common/Solver/ObiSolver.cs:1123)
Obi.ObiActor.AddToSolver () (at Assets/Obi/Scripts/Common/Actors/ObiActor.cs:338)
Obi.ObiActor.OnEnable () (at Assets/Obi/Scripts/Common/Actors/ObiActor.cs:313)

Code:
DllNotFoundException: libOni assembly:<unknown assembly> type:<unknown type> member:(null)
Obi.OniColliderWorld.SetColliders (Obi.ObiNativeColliderShapeList shapes, Obi.ObiNativeAabbList bounds, Obi.ObiNativeAffineTransformList transforms, System.Int32 count) (at Assets/Obi/Scripts/Common/Backends/Oni/OniColliderWorld.cs:40)
Obi.ObiColliderWorld.UpdateWorld (System.Single deltaTime) (at Assets/Obi/Scripts/Common/Collisions/ObiColliderWorld.cs:388)
Obi.ObiUpdater.BeginStep (System.Single stepDeltaTime) (at Assets/Obi/Scripts/Common/Updaters/ObiUpdater.cs:42)
Obi.ObiFixedUpdater.FixedUpdate () (at Assets/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:44)

I tried reimporting from package manager and restarting unity. I still get those errors.
Reply
#2
(10-11-2021, 09:57 PM)fishing-rod Wrote: Hi,

I tried to keep the subject short. I migrated my project from Unity 2020 LTS on a Windows 10 Laptop to Unity 2021.2.1f1 on a M1 Mac.

It actually went way better than I though but when I enter play mode I get these type of errors spammed with different call stacks. Here are two examples:

Code:
DllNotFoundException: libOni assembly:<unknown assembly> type:<unknown type> member:(null)
Obi.OniBackend.CreateSolver (Obi.ObiSolver solver, System.Int32 capacity) (at Assets/Obi/Scripts/Common/Backends/Oni/OniBackend.cs:17)
Obi.ObiSolver.Initialize () (at Assets/Obi/Scripts/Common/Solver/ObiSolver.cs:862)
Obi.ObiSolver.AddActor (Obi.ObiActor actor) (at Assets/Obi/Scripts/Common/Solver/ObiSolver.cs:1123)
Obi.ObiActor.AddToSolver () (at Assets/Obi/Scripts/Common/Actors/ObiActor.cs:338)
Obi.ObiActor.OnEnable () (at Assets/Obi/Scripts/Common/Actors/ObiActor.cs:313)

Code:
DllNotFoundException: libOni assembly:<unknown assembly> type:<unknown type> member:(null)
Obi.OniColliderWorld.SetColliders (Obi.ObiNativeColliderShapeList shapes, Obi.ObiNativeAabbList bounds, Obi.ObiNativeAffineTransformList transforms, System.Int32 count) (at Assets/Obi/Scripts/Common/Backends/Oni/OniColliderWorld.cs:40)
Obi.ObiColliderWorld.UpdateWorld (System.Single deltaTime) (at Assets/Obi/Scripts/Common/Collisions/ObiColliderWorld.cs:388)
Obi.ObiUpdater.BeginStep (System.Single stepDeltaTime) (at Assets/Obi/Scripts/Common/Updaters/ObiUpdater.cs:42)
Obi.ObiFixedUpdater.FixedUpdate () (at Assets/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:44)

I tried reimporting from package manager and restarting unity. I still get those errors.

Hi,

Make sure the /Obi/Plugins folder exists and actually contains the library file for your platform (libOni.a on mac). I’ve only seen this fail when A) the asset was freshly imported with no Unity restart , or B) missing plugin files.

If neither is the case, would you mind sending your project to support(at)virtualmethodstudio.com so that I can take a closer look? Thanks!
Reply
#3
Thanks for your support!

I do see one libOni.a which is in the iOS folder. Is that correct? Does it matter that I'm on apple silicon (M1)?

[Image: Bildschirmfoto-2021-11-11-um-18-48-51.png]

The screenshot is from the package importer, but I can't tick the checkboxes. I think this is because everyhting is already imported. I don't see anything missing in the project view.
Reply
#4
(11-11-2021, 06:48 PM)fishing-rod Wrote: Thanks for your support!

I do see one libOni.a which is in the iOS folder. Is that correct? Does it matter that I'm on apple silicon (M1)?

Everything looks fine! Upon further research, looks like the M1 processor is not backwards compatible with Intel architectures at a hardware level, Apple is using a binary translator (Rosetta 2) to allow binaries compiled for Intel to run on the M1. This might be the culprit since Unity libs might not be correctly translated (or at all) will have to test the precompiled libraries and see if they run on the M1, if they don't, I will have to recompile the libs for M1.

In the meantime you can switch to the Burst backend (which should be used when possible anyway), that will solve the issue as it does not require precompiled libs.
See: http://obi.virtualmethodstudio.com/manua...kends.html
Reply
#5
(12-11-2021, 08:48 AM)josemendez Wrote: Everything looks fine! Upon further research, looks like the M1 processor is not backwards compatible with Intel architectures at a hardware level, Apple is using a binary translator (Rosetta 2) to allow binaries compiled for Intel to run on the M1. This might be the culprit since Unity libs might not be correctly translated (or at all) will have to test the precompiled libraries and see if they run on the M1, if they don't, I will have to recompile the libs for M1.

In the meantime you can switch to the Burst backend (which should be used when possible anyway), that will solve the issue as it does not require precompiled libs.
See: http://obi.virtualmethodstudio.com/manua...kends.html

Alright, thanks for your effort.

Actually I already set Burst as the backend to use. I do see the warning that it depends on the 4 packages though. Is the warning only visible when a package is missing? I tried to look them up in the package manager, but I could only find Burst and Mathematics. Collections and Jobs don't show up. Neither in the Unity Registry nor in the Built In category.

Compilation on Jobs is enabled and Safety Checks is disabled. I don't have the Leak Detection and JobsDebugger menu points.
Reply
#6
(12-11-2021, 09:08 AM)fishing-rod Wrote: I tried to look them up in the package manager, but I could only find Burst and Mathematics. Collections and Jobs doesn't show up. Neither in the Unity Registry nor in the Built In category.

They're preview packages, you need to enable preview packages in the editor:
https://docs.unity3d.com/Manual/pack-preview.html

Quote:I do see the warning that it depends on the 4 packages though. Is the warning only visible when a package is missing?

Once you've got the right package dependencies installed, the ObiSolver component will no longer show up any warnings when you select Burst as your backend, and the DllNotFound exception will go away.
Reply
#7
(12-11-2021, 09:36 AM)josemendez Wrote: They're preview packages, you need to enable preview packages in the editor:
https://docs.unity3d.com/Manual/pack-preview.html


Once you've got the right package dependencies installed, the ObiSolver component will no longer show up any warnings when you select Burst as your backend, and the DllNotFound exception will go away.

I couldn't see the packages even after enabling pre-release packages but I could install them by name. So they are installed now and Jobs has version 0.11.0-preview.6 and Collections 1.0.0-pre.6.

Now I get this error:

Assets/Obi/Scripts/Common/Backends/Burst/DataStructures/Queries/BurstContact.cs(7,19): error CS0101: The namespace 'Obi' already contains a definition for 'BurstContact'

And it makes sense when I check the folder structure. There is a struct BurstContact under .../DataStructure/BurstContact.cs and .../DataStructure/Queries/BurstContact.cs. I have no idea how I did mess up this.
Reply
#8
There's no ".../DataStructures/BurstContact.cs" file included in the package, not sure how it ended up there. The correct path is "/Obi/Scripts/Common/Backends/Burst/DataStructures/Queries/BurstContact.cs"

You can try simply deleting the /DataStructure/BurstContact.cs one, or removing the entire /Obi folder and reimporting the package to make sure files are where they should.
Reply
#9
On a side note regarding Apple's M1:

https://forum.unity.com/threads/unity-on...220/page-7

Seems like the Unity 2021.1 version installed by the hub runs on M1 using Rosetta, the native version needs to be manually downloaded and installed. Under "Component Installers macOS" you'll see a link to "Unity Editor (Apple silicon, preview)":

https://unity3d.com/beta/2021.2b#downloads

Ran into this myself while testing the libs: the Intel version of the editor doesn't run the Intel lib nor the native M1 lib.
Reply
#10
(13-11-2021, 10:36 AM)josemendez Wrote: On a side note regarding Apple's M1:

https://forum.unity.com/threads/unity-on...220/page-7

Seems like the Unity 2021.1 version installed by the hub runs on M1 using Rosetta, the native version needs to be manually downloaded and installed. Under "Component Installers macOS" you'll see a link to "Unity Editor (Apple silicon, preview)":

https://unity3d.com/beta/2021.2b#downloads

Ran into this myself while testing the libs: the Intel version of the editor doesn't run the Intel lib nor the native M1 lib.

That info is not up to date. You can download apple silicon version with unity hub 3: https://forum.unity.com/threads/now-avai...st-7602034

(13-11-2021, 10:29 AM)josemendez Wrote: There's no ".../DataStructures/BurstContact.cs" file included in the package, not sure how it ended up there. The correct path is "/Obi/Scripts/Common/Backends/Burst/DataStructures/Queries/BurstContact.cs"

You can try simply deleting the /DataStructure/BurstContact.cs one, or removing the entire /Obi folder and reimporting the package to make sure files are where they should.

Thank you so much! Everything is now working as expected. The warning for Burst backend has gone and my fishin rods are working again after reimporting.
Reply