Build.gradle
Step 1 - import below the line
Step 2 - add ndk Tag insie defaultConfig tag
defaultConfig {
------
ndk {
}
Step 3 - add splits tag inside Android tag
android {
Step 4 - there are generate multiple apk,
Upload apk : app-universal-release.apk
Step 1 - import below the line
import com.android.build.OutputFile
Step 2 - add ndk Tag insie defaultConfig tag
defaultConfig {
------
ndk {
// config you want to support device
abiFilters 'arm64-v8a', 'armeabi', 'armeabi-v7a', 'x86' , 'x86_64'
}
}
Step 3 - add splits tag inside Android tag
android {
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.
reset()
// Specifies a list of ABIs that Gradle should create APKs for.
include "x86", "x86_64", "armeabi-v7a", "arm64-v8a"
// Specifies that we want to also generate a universal APK that includes all ABIs.
universalApk true
}
}
// Map for the version code that gives each ABI a value.
def abiCodes = ['x86': 1, 'x86_64': 2, 'armeabi-v7a': 3, 'arm64-v8a': 4]
// APKs for the same app that all have the same version information.
android.applicationVariants.all { variant ->
// Assigns a different version code for each output APK.
variant.outputs.each {
output ->
def abiName = output.getFilter(OutputFile.ABI)
output.versionCodeOverride = abiCodes.get(abiName, 0) * 100000 + variant.versionCode
}
}
}
Step 4 - there are generate multiple apk,
Upload apk : app-universal-release.apk
No comments:
Post a Comment