Hi,
According to the documentation, the *AAR* format can use flavors (just
like APK)
*"...For the rest, libraries behave the same as application projects. They
> have build types and product flavors.."*
but it's not working for me when using '*abiFilter*' as a variant, here is
a small POC.
//project structure
.
├── build.gradle
└── src
└── main
├── AndroidManifest.xml
└── jniLibs
├── armeabi
│ └── libsnappydb-native.so
├── armeabi-v7a
│ └── libsnappydb-native.so
├── mips
│ └── libsnappydb-native.so
└── x86
└── libsnappydb-native.so
//*build.gradle*
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.11.1'
}
}
apply plugin: 'android-library'
//apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
versionCode 4
versionName version
}
productFlavors {
x86 {
ndk {
abiFilter "x86"
}
}
mips {
ndk {
abiFilter "mips"
}
}
armv7 {
ndk {
abiFilter "armeabi-v7a"
}
}
arm {
ndk {
abiFilter "armeabi"
}
}
}
}
*//generating an AAR (applying 'android-library' plugin)*
*gradle* *assembleX86Debug*
jar tf build/outputs/aar/poc.aar
AndroidManifest.xml
classes.jar
jni/
jni/armeabi/
jni/armeabi/libsnappydb-native.so
jni/armeabi-v7a/
jni/armeabi-v7a/libsnappydb-native.so
jni/mips/
jni/mips/libsnappydb-native.so
jni/x86/
jni/x86/libsnappydb-native.so
the generated AAR include all ABI despite the fact that we are building
only for 'x86'
*//generating an APK (applying 'android' plugin instead of
'android-library')*
gradle assembleX86Debug
jar tf build/outputs/apk/poc-x86-debug.apk
AndroidManifest.xml
classes.dex
lib/x86/libsnappydb-native.so
META-INF/MANIFEST.MF
the abiFilter works fine when generating an APK
I attached the complete project to reproduce. here
<https://www.dropbox.com/s/w8sf2pu9qwa23zn/poc.tar.gz>
Regards
--
You received this message because you are subscribed to the Google Groups
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.