Jono
Jono

Reputation: 18128

android gradle flavorReleaseCompile not found?

Getting the below error when trying to build flavour types of my lib modules.

Error:(210, 0) Gradle DSL method not found: 'flavourOneReleaseCompile()'
    Possible causes:<ul><li>The project 'MyProject' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
    <a href="fixGradleElements">Fix plugin version and sync project</a></li><li>The project 'MyProject' may be using a version of Gradle that does not contain the method.
    <a href="openGradleSettings">Gradle settings</a></li><li>The build file may be missing a Gradle plugin.
    <a href="apply.gradle.plugin">Apply Gradle plugin</a></li>

build file

android{......}

configurations{
    flavorOneDebugCompile{}
    flavorOneReleaseCompileCompile{}
    flavorTwoDebugCompile{}
    flavorTworeleaseCompile{}
}

dependencies {

 flavorOneDebugCompile project(path: ':lib', configuration: 'flavorOneDebug')
    flavorOneReleaseCompile project(path: ':lib', configuration: 'flavorOneRelease')

    flavorTwoDebugCompile project(path: ':lib', configuration: 'flavorTwoDebug')
    flavorTwoReleaseCompile project(path: ':lib', configuration: 'flavorTwoRelease')


}

Im using

classpath 'com.android.tools.build:gradle:1.3.1'

i was following this guide on how to target specific build flavours

https://developer.android.com/studio/build/gradle-tips.html#target-specific-builds-with-dependency-configurations

Upvotes: 0

Views: 28

Answers (1)

Anurag Singh
Anurag Singh

Reputation: 6200

You are using spelling mistake flavorOneReleaseCompileCompile in

configurations{
flavorOneDebugCompile{}
flavorOneReleaseCompileCompile{}
flavorTwoDebugCompile{}
flavorTworeleaseCompile{}
}

Try replacing flavorOneReleaseCompileCompile with flavorOneReleaseCompile

Upvotes: 1

Related Questions