Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle DSL method not found: 'flavorGroups()'

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()'

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
}

Thank you for your answers.

like image 285
Sierra Avatar asked Jan 30 '15 10:01

Sierra


1 Answers

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.

like image 188
Joel Avatar answered Nov 19 '22 02:11

Joel