如何限制我构建的平台?

时间:2016-09-27 13:38:08

标签: android-ndk build.gradle gradle-experimental

我尝试过abiFilters ["armeabi-v7a"]代替abiFilters.add("armeabi-v7a"),但会导致链接错误和消息:

Execution failed for task ':linkMyModuleArm64-v8aDebugSharedLibrary'

基于此消息,我怀疑该项目仍然是为所有平台构建的......

1 个答案:

答案 0 :(得分:1)

model块内创建android.productFlavors块(您应该已经拥有此块)。然后像这样应用你的abiFilter:

create("arm"){
    dimension = "abi"
    ndk.abiFilters.addAll(['armeabi'])
}

abiFilters.addAll(['armeabi'])添加到主ndk块,将为所有“变体”设置默认值

查看http://tools.android.com/tech-docs/new-build-system/gradle-experimental#TOC-Other-Build-Options