I\'m getting this warning in my project gradle file:
Warning:(16, 5) \'buildTypes\' cannot be applied to \'(groovy.lang.Closure< com.android.build.
In my case my buildTypes section was above my productFlavors section. Interchanging their positions got rid of the warning:
BEFORE:
buildTypes {
debug {
minifyEnabled false
shrinkResources false
...//etc
}
}
productFlavors {
demo {
...//etc
}
}
AFTER:
productFlavors {
demo {
...//etc
}
}
buildTypes {
debug {
minifyEnabled false
shrinkResources false
...//etc
}
}
I am using Android Studio 2.1.2 with the following config at the top of my android section:
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.xyz.abc"
minSdkVersion 14
targetSdkVersion 24
//..etc