Build process wrongly copies a Linux .so native lib instead of the Android one to the final APK. #8794
Labels
Area: App+Library Build
Issues when building Library projects or Application projects.
Android application type
.NET Android (net7.0-android, net8.0-android, etc.)
Affected platform version
.NET 7.0.313
Description
This is .NET Only!
Summary: .NET Android build process copies the wrong
.so
into the generated APK. Having anarm64
device, and aNuGet
with native libs for botharm64-v8a
andlinux-arm64
, it'll copy the Linux ARM64 slice instead of the Android ARM64.Having the NuGet with the native libs structure:
And a client application referencing the NuGet.
The output
.apk
will include alibs
folder, with an appropriatearm64-v8a
folder and thelibdittoffi.so
file. However, the.so
file is thelinux
slice fromlibs/linux/linux-aarch64
, not the Android one 🙃During the build proccess, it identifies properly the
.so
files, this is from the logs:And I manually checked each to be correct. So in the
obj
folder, we're good, but when theapk
is built, thelinux
slice weirdly ends up there.Note: If you simply remove the Linux slices from the NuGet's
runtimes
folder and rebuild, it copies the right Android lib.Steps to Reproduce
ditto-4.6
)DllNotFoundException
:libdittoffi.so
file is there, but it's the wrong one:Did you find any workaround?
No. Just by removing the linux slice from the NuGet, but this is not exactly a workaround.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: