我正在基于 ABI 构建发布 apk,因为要在Play 商店上发布的 apk 大小。
所以我开始为ABI = armeabi-v7a构建 apk,然后构建ABI = x86 和 ABI = areambi
所以我的gradle看起来像这样
应用程序等级
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.package"
minSdkVersion 18
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
ndk {
abiFilters "armeabi-v7a"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
ndkBuild {
path 'src/main/jni/Android.mk'
}
}
splits {
// Configures multiple APKs based on ABI.
abi {
// Enables building multiple APKs per ABI.
enable true
// By default all ABIs are included, so use reset() and include to specify that we only
// want APKs for x86, armeabi-v7a, and mips.
// Resets the list of ABIs that Gradle should create APKs for to none.
reset()
// Specifies a list of ABIs that Gradle should create APKs for.
include "armeabi-v7a"
// Specifies that we do not want to also generate a universal APK that includes all ABIs.
universalApk false
}
}
}
所以我的问题
- 我需要
versionCode 1
对每个 ABI 进行更改,因此我应该使用哪个 ABI 的版本代码。