-
Couldn't load subscription status.
- Fork 561
Description
Android application type
.NET Android (net7.0-android, net8.0-android, etc.)
Affected platform version
VS 2022 Update 9, net8.0-android
Description
When my new Avalonia Android project consumes a native library, at runtime it throws DllNotFoundException.
These native libraries come by way of NuGet. I've tried Nerdbank.Zcash and libgit2sharp. Both of these carry a runtimes folder. The Nerdbank.Zcash package in particular carries a runtimes/android-x64/native/libnerdbank_zcash_rust.so file.
I can see that the file is included in the apk. But the android emulator still fails.
More details and diagnostic efforts are described in AArnott/Avalonia-WithNativeDependency#1
Steps to Reproduce
A minimal repro is available here: https://github.com/AArnott/Avalonia-WithNativeDependency
Be sure to switch the solution platform to x64, since in AnyCPU, no native binary is included in the deployed app.
In effect:
- Create a new Avalonia Android app. Bump its target framework from
net7.0-androidtonet8.0-android. - Add a PackageReference to Nerdbank.Zcash
- Add code that exercises the native library, for example these two lines.
Run the app in the android emulator. (I haven't tried a real android device).
Did you find any workaround?
Nothing yet.
Relevant log output
No response