1

when I run my android app i have 3 errors

1)

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.

2)

Error:1 error; aborting
:app:transformClassesWithDexForDebug FAILED

3)

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.7.0_55\bin\java.exe'' finished with non-zero exit value 1
  • did you try to `clean project` then `rebuild project`? – mgcaguioa Jun 10 '16 at 02:39
  • 1
    Possible duplicate of [Android Studio 2.1 Error converting bytecode to dex](http://stackoverflow.com/questions/37084912/android-studio-2-1-error-converting-bytecode-to-dex) – Arjan Jun 10 '16 at 02:39
  • yes, i did it @mgcaguioa – Jonatan Jourdan Jun 10 '16 at 02:58
  • i have alredy `compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 }` and `allprojects { tasks.withType(JavaCompile) { sourceCompatibility = "1.7" targetCompatibility = "1.7" } }` and the error still @Arjan – Jonatan Jourdan Jun 10 '16 at 03:00
  • if your using `google play services`, this link might help you >> http://stackoverflow.com/questions/35890257/android-errorexecution-failed-for-task-apptransformclasseswithdexforrelease – mgcaguioa Jun 10 '16 at 03:21
  • 1
    *"This is caused by library dependencies that have been compiled using Java 8 or above."*. Which dependency is compiled using Java 8? Including your gradle.build might enable someone to help you. There's some more info on these pages http://stackoverflow.com/questions/37020413/android-dex-cannot-parse-version-52-byte-code http://stackoverflow.com/a/36975041/6178459 Suggested solutions are either to compile the entire project as java 8 or downgrade the dependency. Also possibly related, http://stackoverflow.com/questions/21028438/gradle-sourcecompatibility-has-no-effect-to-subprojects – Arjan Jun 10 '16 at 04:29

0 Answers0