I am getting the following error since I updated the android studio from 2.0 to 2.1.
Error:Error converting bytecode to dex:
Cause: Dex ca
Possibile duplicate of Android: Dex cannot parse version 52 byte code. The most quoted answer solved the problem for me.
I added compileOptions and jackOptions as shown below to my build.gradle to use JDK 1.8.
android {
...
defaultConfig {
...
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
Try
allprojects {
tasks.withType(JavaCompile) {
sourceCompatibility = "1.7"
targetCompatibility = "1.7"
}
}
in the main build.gradle
file
Remove the dependencies from build.gradle, comment relevant code and then compile and clean your project.
After a successful clean add the dependencies again and uncomment what you commented after removing the dependencies earlier.