从Realm中删除x86_64包

时间:2016-08-26 06:37:11

标签: android realm

我正在与AS合作,我不需要在领域中使用x86_64软件包。 x86_64包导致其他库出现一些问题。如何删除包裹?

enter image description here

2 个答案:

答案 0 :(得分:1)

好吧,你可以删除任何架构文件夹,但请记住,这意味着有问题的库(这种情况下它的领域)将不适用于你删除的那些架构。

坦率地说,你可以简单地删除它,但正如我上面提到的那样,这是不好的。

您可以通过名为splitting

的技术在构建中包含/排除不同的体系结构
android {
    // Rest of Gradle file
        splits {
            abi {
            enable true
            reset()
            include 'armeabi', 'armeabi-v7a', 'arm64_v8a', 'mips', 'x86'
            universalApk true
        }
    }
}

//Ensures architecture specific APKs have a higher version code
//(otherwise an x86 build would end up using the arm build, which x86 devices can run)
ext.versionCodes = [armeabi:1, 'armeabi-v7a':2, 'arm64-v8a':3, 'mips':4, x86:5]

android.applicationVariants.all { variant ->
    // assign different version code for each output
    variant.outputs.each { output ->
        int abiVersionCode = project.ext.versionCodes.get(output.getFilter(OutputFile.ABI)) ?: 0
        output.versionCodeOverride = (abiVersionCode * 10000) + android.defaultConfig.versionCode
    }
}

答案 1 :(得分:1)

Achieve将是一个很好的解决方案。该方法将限制abi,并且仅在构建apk时添加指定的abi。

abiFilters

这意味着只会使用那些指定的arch文件夹,其余的可以删除。