Gradle dependent Android plugin options: DSL method not found

I have a project with several flavors, with flavors called qa and prod. I need to include different versions of the library depending on the type of assembly and taste.

The documentation at http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Type-Product-Flavor-Build-Variant suggests that assembly types and tastes can be combined using notation "flavorBuildCompile". However, when I do this, I get this error:

Error:(88, 0) Gradle DSL method not found: 'qaDebugCompile()' 

I am sure this worked (in the old version of gradle). Currently using gradle 2.1. I did not find an explanation whether the way to do this has changed.

Note that it works great if I use the flavorCompile notation, it only fails when I also include the build type.

Here is the outline of my build script:

 android { compileSdkVersion 17 buildToolsVersion "20" ... productFlavors { qa { applicationId "com.myapp.qa" } prod { applicationId "com.myapp.prod" } } sourceSets { main { java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] manifest.srcFile 'AndroidManifest.xml' } qa { res.srcDirs = ['res_qa'] } prod { res.srcDirs = ['res_prod'] } } } ... dependencies { compile fileTree(dir: 'libs', include: '*.jar') qaCompile 'com.myapp.integration:other_lib: 3.0+@aar ' //this is fine qaDebugCompile 'com.myapp.integration:mylib_qa: 3.0+@aar ' //this fails! prodDebugCompile 'com.myapp.integration:mylib_prod: 3.0+@aar ' qaReleaseCompile 'com.myapp.release:mylib_qa: 3.0+@aar ' prodReleaseCompile 'com.myapp.release:mylib_prod: 3.0+@aar ' } 
+7
android gradle
source share

No one has answered this question yet.

See related questions:

1858
"Debug certificate expired" error in Android Eclipse plugins
1206
What is Gradle in Android Studio?
474
Gradle DSL method not found: 'runProguard'
459
Using gradle to find the dependency tree
425
How to make gradle reload dependencies?
5
Android Gradle 1.0 Compute version code in setup with multiple tastes
3
Search Ivy track, but not Ivy config / repo configuration
one
Android Gradle Build Variants - application not recognized on Google Upload
0
Migration from eclipse to Android studio "Error: (1, 0) Plugin with identifier" com.android.application "not found"
0
Android build types with different sets of sources

All Articles