I tried several ways to import a .so file into my project in Maui, in all cases it gives the error:
System.EntryPointNotFoundException: 'nativeCreateCamera'
This is a code example i am trying to import:
public class NativeLibs { private const string Library = "libmlcamera-2.5.so"; private long mNativePtr = nativeCreateCamera(); // The error occurs here [DllImport(Library, EntryPoint = "nativeCreateCamera", CallingConvention = CallingConvention.Cdecl)] private static extern long nativeCreateCamera(); }
I have imported the .so files in Platforms/Android/Resources/lib/arm.../libmlcamera-2.5.so
Also i have instanciated in csproj
<ItemGroup><EmbeddedNativeLibrary Include="Platforms/Android/Resources/lib/arm64-v8a/libmlcamera-2.5.so"/><EmbeddedNativeLibrary Include="Platforms/Android/Resources/lib/armeabi-v7a/libmlcamera-2.5.so"/></ItemGroup>
What i am doing wrong?