1

My application is not yet migrated to gradle, we still use Ant build script. Recently one of our dependent libraries started using Java 8 features.

In order to compile using Java-8 lib, configured ant script to use java 1.8. with this change, the compilation is successful, but failing in dex phase.

With 20.x build tools I got

"Bad Class File Magic (cafebabe)" error.

With 24.x build tools I got

"[dex] PARSE ERROR: unsupported class file version 52.0"

Seems to get rid of the dex error, i need to use jack toolchain, however as mentioned earlier, I am not using Gradle builds.

Is there any way to use dex with java-8 code? or Jack tools is the only solution?

Rao
  • 20,781
  • 11
  • 57
  • 77
R K
  • 21
  • 5
  • 1
    Which Java 8 language feaures and Java 8-specific APIs do you use in your library? If, for example, it is only Lambdas / method references it could be done with [retrolambda](https://github.com/orfjackal/retrolambda). If you are also using new Java 8 APIs it's a different story. – Sartorius Oct 17 '16 at 18:46
  • An example is using a static interface definition: public static IInAppBillingService asInterface(IBinder obj) The latest version of IInAppBillingService.class you upgraded to contains static interface methods, a new feature that is only compatible with Java version 1.8. – user107172 Mar 03 '17 at 00:34

0 Answers0