简体   繁体   中英

How to create apk file for specific cpu architecture

I already know about split option available on gradle, which generates multiple apk for different cpu architectures.

How can I generate an apk included just armeabi-v7a and x86 architecture?

Step 1: Add the class path dependency to the project level build.gradle file.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath "io.realm:realm-gradle-plugin:3.7.1"
    }
}

Step 2: Apply the realm-android plugin to the top of the application level build.gradle file.

apply plugin: 'realm-android'

Step3: Add this to the application’s build.gradle:

realm {
  syncEnabled = true;
}

Step4:Add this to the application’s build.gradle:
android{
   defaultConfig{
       applicatioId "com.android.abi.myapplication"
       minSdkVersion 16
       targetSdkVersion 25
       ndk{
           abiFilters "armeabi-v7a", "x86" // Add only required cpu architectures here
       }
   }
}

and Then sync the gradle and build the apk , will find only library files for armeabi-v7a and x86.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM