Historically the NDK supported ARMv5 (armeabi
), and 32-bit and 64-bit MIPS
, but support for these ABIs was removed in NDK r17.
Also, note below anouncement from Google:
Starting August 1, 2019, your apps published on Google Play will need to support 64-bit architectures. 64-bit CPUs deliver faster, richer experiences for your users. Adding a 64-bit version of your app provides performance improvements, makes way for future innovation, and sets you up for devices with 64-bit-only hardware.
So, you should stop using the legacy armeabi
for your Android applications. And, start to use the 64-bit ABIs.
See https://developer.android.com/distribute/best-practices/develop/64-bit
and https://developer.android.com/ndk/guides/abis for more details.
For how to organise the debug and release build type, theoretically, you can put the mynative-lib.so
anywhere you like, e.g. they are under /Users/<your-usr-name>/android/jniLibs
. But, I would like recommend you to arrange your debug and release build types as below (per each supported ABI):
jniLibs
├── debug
│ ├── arm64-v8a
│ │ └── mynative-lib.so
│ ├── armeabi-v7a
│ │ └── mynative-lib.so
│ ├── x86
│ │ └── mynative-lib.so
│ └── x86_64
│ └── mynative-lib.so
└── release
├── arm64-v8a
│ └── mynative-lib.so
├── armeabi-v7a
│ └── mynative-lib.so
├── x86
│ └── mynative-lib.so
└── x86_64
└── mynative-lib.so
Then configure your app/build.gradle
file for it to point to the correct build types, i.e.
android {
...
sourceSets {
main {
// put your jni libs that do not distinguish debug and release.
jniLibs.srcDirs += "/Users/<your-usr-name>/android/jniLibs"]
}
debug {
// put your debug version jni libs.
jniLibs.srcDirs += "/Users/<your-usr-name>/android/jniLibs/debug"]
}
release {
// put your release version jni libs.
jniLibs.srcDirs += "/Users/<your-usr-name>/android/jniLibs/release"]
}
}
...
}
NOTE: Replace /Users/<your-usr-name>/android/jniLibs
with your own correct path.