Error compiling Android

0

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
}
    
asked by anonymous 08.08.2016 / 04:55

1 answer

1

Some of the dependencies of your project have been compiled with Java 8, but you are using Java 7 in the project. Put your project to use Java 8 or recompile the library that is causing the problem after making the necessary change.

    
08.08.2016 / 06:04