mcneel / rhino3dm

Libraries based on OpenNURBS with a RhinoCommon style
MIT License
613 stars 139 forks source link

DllNotFoundException for 'librhino3dm_native' on Android (.NET MAUI) #633

Open if-mindesk opened 4 months ago

if-mindesk commented 4 months ago

Hi, I built a minimal .NET MAUI app that reads a 3dm file using File3dm.Read function. On Windows it runs fine but when I try on Android phone using one of the emulators available with VS it fails with the exception DllNotFoundException for 'librhino3dm_native'. You can find the repro project in the attached file. I verified that the generated apk contains the librhino3dm_native.so file inside the folder lib-> x86_64. To use it press the 'Pick rhino 3dm file' button and select a 3dm file.

TestRhino3dm.zip

I don't know if the issue is caused by the rhino nuget package or by MAUI. Anyway any help will be useful.

if-mindesk commented 4 months ago

Since I don't know if the problem is caused by Maui or by Rhino package I also opened an issue on MAUI https://github.com/dotnet/android/issues/9536

fraguada commented 3 months ago

Many times this error is thrown even though you might have a native library in a folder. It is thrown because it does not find a compatible native library. We are not currently building an Android compatible dotnet library. We used to do this, but stopped due to some complexities in the build pipeline. It is probably a good time to revisit this.

if-mindesk commented 3 months ago

Hi, do you have an estimate of when when a preview of an Android compatible dotnet library will be available? The old Rhino3dmIO.Android can't be used with .NET 7 and 8 because it depends on System.Drawing.Common that is only supported on Windows.

Thank you

fraguada commented 2 months ago

No, I don't have an estimate.