apk - Android product flavors are not considered when using CPU ABI split in build.gradle -
i want make apk split based on cpu abi according http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits, want split apk product flavor.
so build.gradle
file has following product flavors plain
, market
. want apk split performed when building market
flavor.
android { productflavors { plain { } market { splits { abi { enable true reset() include 'armeabi', 'armeabi-v7a', 'x86', 'mips' universalapk true } } } } }
however, when invoke gradle assembleplaindebug
, assemblemarketdebug
, both of them produces multiple apk. there wrong configuration above?
i'm using com.android.tools.build:gradle:1.2.3
.
i've been looking way while , haven't found solid solution. splits having run before resolving buildtypes , productflavors.
the android gradle - use splits release possible? question had answer thought useful. relies on project property, passed in when building via command line or continuous integration invironment, set weather split apk's option enabled or not.
i used this:
splits { abi { enable project.hasproperty('splitapk') reset() include 'x86', 'armeabi-v7a', 'mips', 'armeabi' universalapk true } }
and depending on falvour or build type building can include:
./gradlew --project-prop splitapk assemblemarketdebug
this should enable apk split when explicitly told , should stay disabled else.
Comments
Post a Comment