In Android Studio 3.2.1 I had two build variants visible for my native library; Release and Debug. In 3.3 I get a combination of these and all ABIs. I don't want to build multiple APKs for all the ABIs.
The relevant parts of the native library project:
apply plugin: 'com.android.library'
android {
defaultConfig {
ndk {
// Specifies the ABI configurations of your native
// libraries Gradle should build and package with your APK.
abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
}
}
buildTypes {
release {
}
debug {
}
}
externalNativeBuild {
ndkBuild {
path 'jni/Android.mk'
}
}
sourceSets {
main {
java.srcDir generatedSrcDir
}
}
sourceSets {
main {
jni.srcDirs = []
}
}
}
Build warnings
Maybe unrelated, but I observed this warning in the Build log (actually twice in a row):
WARNING: ABIs [arm64-v8a,armeabi-v7a,armeabi] set by 'android.injected.build.abi' gradle flag contained 'ARMEABI' not targeted by this project.
How do I get back to the old behavior?
Apparently this is an intentional change: see this issue.
According to the linked ticket, this is only "cosmetic"(ie a UI change); a full/fat .apk is still built.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With