I have a C library that I am hoping to wrap in JNI and call from my android project. The .so file is the following architecture: i386:x86-64. Whenever I add it to my project inside the src/main/jniLibs/arm64-v8a|armeabi-v7a|x86 folders, I get an error saying the .so file is 64-bit instead of 32-bit. I have tried cross-referencing this issue and noticed that people usually get the opposite issue, where the .so was 32-bit instead of 64-bit. I've tried combing through Android documentation to see where I messed up but can't seem to find a solution.
Asked
Active
Viewed 1,773 times
1

user207421
- 305,947
- 44
- 307
- 483

Daniel Rust
- 539
- 1
- 4
- 15
-
2The solution is to either use a 64-bit JVM or a 32-bit version of the C library. They have to match. – user207421 May 01 '18 at 01:08
1 Answers
4
A 64-bit library should not be in src/main/jniLibs/armeabi-v7a folder. If your device supports arm64-v8a ABI, the app will be using the 64-bit library. If the device is not compatible, you cannot use this library.

Alex Cohn
- 56,089
- 9
- 113
- 307
-
https://stackoverflow.com/questions/59027837/force-app-to-run-32-bit-architecture-for-64-bit-devices?noredirect=1#comment104301237_59027837 – Lavanya Velusamy Nov 26 '19 at 17:03
-