Android application you can build APK for specific CPU . You just need to config your app gradle
with some properties and CPU name
you can splits function to achieve your goal . now you just put below function into your app gradle file like below mention
with some properties and CPU name
you can splits function to achieve your goal . now you just put below function into your app gradle file like below mention
splits { 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 "x86", "armeabi-v7a"
// Specifies that we do not want to also generate a universal APK that includes all ABIs.
universalApk false
}
}
In this code I config here 2 type CPU "x86" and "armeabi-v7a" and based on
this APK will be generate .
Full gradle file details below
apply plugin: 'com.android.application' android { compileSdkVersion 29buildToolsVersion "29.0.2"defaultConfig { applicationId "com.ntss.test"minSdkVersion 19targetSdkVersion 29versionCode 1versionName "1.0"testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled falseproguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'} } 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 "x86", "armeabi-v7a" // Specifies that we do not want to also generate a universal APK that includes all ABIs. universalApk false } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.0.2'implementation 'com.google.android.material:material:1.0.0'implementation 'androidx.constraintlayout:constraintlayout:1.1.3'implementation 'androidx.navigation:navigation-fragment:2.0.0'implementation 'androidx.navigation:navigation-ui:2.0.0'implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
testImplementation 'junit:junit:4.12'androidTestImplementation 'androidx.test.ext:junit:1.1.0'androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'}
for more details you can see this like
No comments:
Post a Comment