2

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?

Hojjat
  • 815
  • 1
  • 10
  • 25
  • please see this answer: http://stackoverflow.com/questions/19268647/gradle-android-build-for-different-processor-architectures/19554367#19554367 – Sergey Nikitin Oct 24 '16 at 08:44

1 Answers1

3
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.

rineez
  • 753
  • 13
  • 33
ganaidu
  • 96
  • 1
  • 3
  • 1
    First step for you: look into improving the formatting of your answer. Only use 4 spaces for **code** segments. That **preview** window exists for a reason! – GhostCat Sep 12 '17 at 06:50