Getting this on android studio 2.2.
Does anyone have a workaround?
My app build file is:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "acme.cb2"
minSdkVersion 18
targetSdkVersion 24
versionCode 1
versionName "1.0"
jackOptions {
enabled true
}
}
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:24.1.1'
compile 'com.android.support:support-v4:24.1.1'
}
edit: modifid the main build file to include answer from https://stackoverflow.com/users/5753091/mohammadreza-khalifeh - but this did not help
import java.text.SimpleDateFormat
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'org.hidetake:gradle-ssh-plugin:2.4.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xbootclasspath/a:" + System.properties.get("java.home") + "/lib/rt.jar"
}
}
}
edit: adding:
options.compilerArgs.each { println 'option: '+it}
prints out:
option: -Xbootclasspath/a:C:\Program Files\Java\jdk1.8.0_92\jre/lib/rt.jar
It looks like the space in the path might cause a problem?
edit: trying:
options.compilerArgs << "\""+"-Xbootclasspath/a:" + System.properties.get("java.home") + "/lib/rt.jar"+"\""
does not work either.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With