I m trying to use a rust pre-build library in my flutter project. I put my core.so in android/app/src/main/jniLibs/ directory, both in "arm64-v8a" and "armeabi-v7a" sub directory ofcourse. Then I add main.jniLibs.srcDirs = ['src/main/jniLibs'] in app/build.gradle And I load my so in dart:
> final DynamicLibrary greeterNative = Platform.isAndroid
> ? DynamicLibrary.open("rustcore.so") : DynamicLibrary.process(); then define the method: typedef GetGenesisFunction = Pointer<Uint8>
> Function(Pointer<Uint8>, int); typedef GetGenesisFunctionFFI =
> Pointer<Uint8> Function(Pointer<Uint8>, Int32); final
> GetGenesisFunction rustGenesis =
> greeterNative.lookup<NativeFunction<GetGenesisFunctionFFI>>("rust_call").asFunction();
Okay, I run my flutter app in debug and profile mode, and everthing is ok, the method from rust core.lib works. However, when I build with "--release" , it tells me: I/flutter ( 8547): Invalid argument(s): Failed to load dynamic library (dlopen failed: library "core.so" not found) I found the release apk and decompress it, I can see the core.so is right there with "libflutter.so" and "lipapp.so" so What's the problem, thank you so much~~~~