问题描述
我试图创建依据本与Android工作室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()'
我使用的是2.2.1的gradle,采用Android 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的摇篮pluging收到这改变了 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.
这篇关于摇篮DSL方法未找到:'flavorGroups()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!