簡體   English   中英

如何為特定的 cpu 架構創建 apk 文件

[英]How to create apk file for specific cpu architecture

我已經知道 gradle 上可用的 split 選項,它為不同的 cpu 架構生成多個 apk。

如何生成僅包含 armeabi-v7a 和 x86 架構的 apk?

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
       }
   }
}

然后同步 gradle 並構建 apk ,將僅找到 armeabi-v7a 和 x86 的庫文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM