Dagger: Error:Error converting bytecode to dex: Cause: Dex cannot parse version 52 byte code.

Created on 5 Mar 2017  路  2Comments  路  Source: google/dagger

Dagger libs used for android.

           compile 'com.google.dagger:dagger:2.10-rc1'
           annotationProcessor 'com.google.dagger:dagger-compiler:2.10-rc1'
 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.
  ...while parsing dagger/Binds.class
  Error:1 error; aborting
  Error:Execution failed for task ':app:transformClassesWithDexForDebug'.

com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: Unable to pre-dex 'C:\Users\Raghu.gradle\caches\modules-2\files-2.1\com.google.dagger\dagger\2.10-rc1\775d8608178ddadfec0be8b5f960b3827d9e9fec\dagger-2.10-rc1.jar' to 'F:\AndroidProjects\rxify-master\rxify-master\appbuildintermediates\pre-dexed\debug\dagger-2.10-rc1_e66a3f81726b8b110d85a47748a2005e1db8ae82.jar'

Looking at the error i tried

  tasks.withType(JavaCompile) {
    sourceCompatibility = "1.7"
    targetCompatibility = "1.7"
}

But that also din't solve the problem.

Most helpful comment

This is fixed in 2.10-rc2.

All 2 comments

This is fixed in 2.10-rc2.

Dupe of #593 and #594

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pyricau picture pyricau  路  4Comments

pedrovarela86 picture pedrovarela86  路  3Comments

rciovati picture rciovati  路  3Comments

blackberry2016 picture blackberry2016  路  3Comments

cesar1000 picture cesar1000  路  3Comments