Replies: 2 comments 2 replies
-
For the record this is something that Unfortunately |
Beta Was this translation helpful? Give feedback.
-
Hey, did you guys figure this out? I was initially initially using https://github.com/rust-mobile/xbuild and extracting the libs from the resulting apk/aab manually. However xbuild does not support x86. On second thought, maybe i don't need x86 support as it seems to be extremely rare. |
Beta Was this translation helpful? Give feedback.
-
Hi!
Ive been trying to use cargo ndk with a bigger rust library.
The library is generating Java JNI bindings through a generator called "flapigen". (So its not a direct cmake project)
After building the APK with
gradlew aR
, which triggersgradlew jar
(For making the Java side of the generated bindings) and a gradle task for runningcargo ndk -t ${arch} -o ${libsPath} build --release
.Yea.. a bit of a trip :D But in the end the APK gets generated, and properly links with the generated jar.
When i install the APK, it also loads the native library correctly, however, one of the native parts needs
libc++_shared.so
(for i think a rust dependency, im in a bit over my head!).According to .. the internet it should compile with that
.so
when i setAPP_STL:=c++_shared
inApplication.mk
, orHowever, inspecting the APK, it doesnt have it incuded.
The error:
Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libc++_shared.so" not found: needed by /data/app/~~1wFPIY2YxMCnGcnEq7pBpA==/org.example-MjRM-ZMHEp1x9fjGfZEjrA==/base.apk!/lib/arm64-v8a/libexample_java.so in namespace classloader-namespace
.Ive tried building on NDK 20, 21 and 23, and targeting SDK 27, 28 and 29 to no avail.
Using gradle-6.7.1, if it makes a difference
Any pointers you can give me?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions