I try to embedd an external library to my .Net MAUI project, but am unable to.
Following the process in this question:
- I copied the
.so
file into<project root>\Resources\lib\<platform>\
(the platforms beingarm64-v8a
,armeabi-v7a
andx86_64
). - Then set the
Build Action = AndroidNativeLibrary
for the file - I set the
<AndroidNativeLibrary Include="Resources\lib\<platform>" />
in my.csproj
file - Then I call
JavaSystem.LoadLibrary(lib name);
in theMainActivity.cs
file of the Android project (which is my target platform)
As soon as my App is starting I receive a Java.Lang.UnsatisfiedLinkgError: 'dlopen failed: library libc++_shared.so" not found'
Why do I get this Error? My interpretation is, that the path to my library is wrong or the file is not correctly included into the build process, but I don't know why my previous steps are not sufficient.
I already tried to solve this by:
- moving the path of the
.so
file into the platform specific folders\Platforms\Android\lib\<platform>
- changing the
<CopyToOutputDirectory></CopyToOutputDirectory>
to various options
Unfortunately without success.
Edit: Fixing a typo