找不到 Gradle DSL 方法:'flavorGroups()' [英] Gradle DSL method not found: 'flavorGroups()'
问题描述
我正在尝试根据这个教程和android studio创建一个ndk项目当我尝试同步我的 gradle 时出现此错误:
I'm trying to create a ndk project with android studio according this tutorial and I get this error when I try to sync my gradle:
Gradle DSL method not found: 'flavorGroups()'
我正在使用 gradle 2.2.1 和 android studio 1.0.2.这是我的 gradle 文件的一部分:
I'm using gradle 2.2.1, with android studio 1.0.2. Here is a part of my gradle file:
defaultConfig.versionCode = 1
flavorGroups "abi"
productFlavors {
x86 {
flavorGroup "abi"
ndk {
abiFilter "x86"
}
versionCode = 3
}
arm {
flavorGroup "abi"
ndk {
abiFilter "armeabi-v7a"
}
versionCode = 1
}
mips {
flavorGroup "abi"
ndk {
abiFilter "mips"
}
versionCode = 2
}
fat {
flavorGroup "abi"
versionCode = 0
}
}
applicationVariants.all { variant ->
def abiVersion = variant.productFlavors.get(1).versionCode
variant.mergedFlavor.versionCode = abiVersion * 100000 + defaultConfig.versionCode
}
感谢您的回答.
推荐答案
Android Gradle 插件收到更新,将 flavorGroups
的名称更改为 flavorDimensions
.您还必须将每个 flavorGroup
的名称更改为 flavorDimension
.如果您进行了更改,那么您将不会再收到该错误.
The Android Gradle pluging received an update which changed the name of flavorGroups
to flavorDimensions
. You will also have to change the name of each flavorGroup
to flavorDimension
. If you make that change then you won't receive that error any more.
这篇关于找不到 Gradle DSL 方法:'flavorGroups()'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!