At the time of compiling, the following error occurs:
:app:transformClassesWithDexForDebug FAILED
Error:1 error; aborting
Error:Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the 'java' gradle plugin in a library submodule add
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException:java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\Java\jdk1.8.0_91\bin\java.exe'' finished with non-zero exit value 1
build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
//compile 'com.android.support:support-v4:22.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
}
}
allprojects { repositories { jcenter () } }
task clean(type: Delete) {
delete rootProject.buildDir
}