I want to load a C Dynamic Library
in flutter
, how can I specify the path, and open it? is it possible to add .so
file to the asset
folder?
final dynamicLibrary = DynamicLibrary.open(libraryPath);
final Pointer<Utf8> Function() _someMethod = dynamicLibrary
.lookup<NativeFunction<Pointer<Utf8> Function()>>(
'native_some_method',
)
.asFunction();
No, you can't, Because Android has multiple system kernels for example X86, X86-32 etc. If you add some .so (shared library) under the asset folder maybe you can use just one simulator. That's the way .c or .cpp files should compile with Android NDK.