-
-
Save ph0b/69586260bc20c58136ef to your computer and use it in GitHub Desktop.
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 21 | |
buildToolsVersion "21.1.2" | |
defaultConfig{ | |
minSdkVersion 14 | |
targetSdkVersion 21 | |
versionCode 101 | |
versionName "1.0.1" | |
} | |
splits { | |
abi { | |
enable true | |
reset() | |
include 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a' //select ABIs to build APKs for | |
universalApk true //generate an additional APK that contains all the ABIs | |
} | |
} | |
// map for the version code | |
project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, 'mips': 5, 'mips64': 6, 'x86': 8, 'x86_64': 9] | |
android.applicationVariants.all { variant -> | |
// assign different version code for each output | |
variant.outputs.each { output -> | |
output.versionCodeOverride = | |
project.ext.versionCodes.get(output.getFilter(com.android.build.OutputFile.ABI), 0) * 1000000 + android.defaultConfig.versionCode | |
} | |
} | |
} |
Noobie question, which apk I am supposed to upload to Google Play Store? I thought I had to add every variance generated but... I can only add one file so... what? Maybe I'm missing something. I know there's a "universal" version, am I supposed to upload that file? How is Google Play going to know there were more version from the same apk!
@iroyo, In case you didn't find an answer for this: you need to switch to advanced mode on Play Console, to be able to upload multiple APKs to production.
project.ext.versionCodes.get(output.getFilter(com.android.build.OutputFile.ABI), 0) * 1000000 + android.defaultConfig.versionCode
Gives me an error
Error:(39, 0) Ambiguous method overloading for method java.lang.Integer#plus.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
[class java.lang.Character]
[class java.lang.String]
[class java.lang.Number]
Open File
The error was because my
versionCode 102
versionName "1.0.2"
was set in an xml file.
I moved it to the defaultConfig and it fixed it
Hi, i had some cppFlags that were specific for some ARM and some for x86, in the above gradle, how do i specify ABI specific flags?
hi , i tried your scheme but uploading on play store is giving me error fully shadow apk on my apk's , you can check more details here
kindly help, as i am unable to upload my apk on play store until this issue resolve. its a brand new app with no previous versions uploaded.
How can I split 2 ABIs to the APK file like universalApk does?
Example I want to build 'x86' + 'x86_64' to one apk file and 'armeabi-v7a' + 'arm64-v8a' to another apk files instead of universalApk.