I'm currently using Gradle Experimental 0.2.1, however I cannot use a more recent version.
I don't know if it's related but I need to use the new Vectore Support.
I tried adding vectorDrawables.useSupportLibrary = true
to defaultConfig.with
block but Gradle Sync will fail saying it does not recognize this feature.
The error I get is :
Error:No such property: vectorDrawables for class: com.android.build.gradle.managed.ProductFlavor
This is my Gradle Build File :
apply plugin: 'com.android.model.application'
model {
android {
compileSdkVersion = 23
buildToolsVersion = '22.0.1'
defaultConfig.with {
applicationId = "my.application.com
minSdkVersion.apiLevel = 18
targetSdkVersion.apiLevel = 23
versionCode = 1
versionName = "1.0"
vectorDrawables.useSupportLibrary = true // this will fail
}
}
android.packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/DEPENDENCIES'
}
// NDK
android.ndk {
moduleName = "MyAwesomeJNILib"
cppFlags += "-std=c++11"
stl = 'gnustl_shared'
}
android.buildTypes {
release {
minifyEnabled = false
proguardFiles += file('proguard-rules.pro')
}
debug {
minifyEnabled = false
proguardFiles += file('proguard-rules.txt')
debuggable = true
}
}
android.productFlavors {
create("demo") {
applicationId = "my.application.com.demo"
}
create("dev") {
applicationId = "my.application.com.dev"
}
}
compileOptions.with {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
}
}
In the dependancies block I made sure to use
compile 'com.android.support:appcompat-v7:23.4.0'