Getting this on android studio 2.2.
Does anyone have a workaround?
My app build file is:
apply plugin: \'com.android.application\'
android {
I had this problem after adding Guava
library to my dependencies.
Solution was to downgrade lib version from com.google.guava:guava:21.0
to com.google.guava:guava:20.0
.
Also, I'm using classpath 'com.android.tools.build:gradle:2.5.0-alpha-preview-01`
EDIT: As you don't use this library please try to change:
build.gradle
classpath 'com.android.tools.build:gradle:2.2.0'
to com.android.tools.build:gradle:2.5.0-alpha-preview-01
in app build.gradle
compileSdkVersion 24
to 25
buildToolsVersion "24.0.2"
to 25.0.2
in gradle-wrapper.properties
distributionUrl=https://services.gradle.org/distributions-snapshots/gradle-3.5-20170213202653+0000-all.zip
upgrading android studio, the following seems to work (but it's really slow now):
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "acme.cb2"
minSdkVersion 22
targetSdkVersion 25
versionCode 1
versionName "1.0"
jackOptions {
enabled true
}
}
dexOptions {
//javaMaxHeapSize "4G"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:support-v4:25.2.0'
}
add this in your build.gradle:
allprojects {
repositories {
jcenter()
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xbootclasspath/a:" + System.properties.get("java.home") + "/lib/rt.jar"
}
}
}
Try
classpath 'com.android.tools.build:gradle:2.3.+'
and
minSdkVersion 25