-2
Error:com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
1 error; aborting
    at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
    at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
    at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
UNEXPECTED TOP-LEVEL EXCEPTION:
    at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
    at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
    at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
    at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
    at com.android.dx.command.dexer.Main.processClass(Main.java:749)
    ... 12 more
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-oracle/bin/java'' finished with non-zero exit value 1
Chintan Desai
  • 2,607
  • 2
  • 22
  • 25

1 Answers1

0

This is usually a compatibility problem between java versions when you introduce new jars.

First try adding compatiblity to gradle with

apply plugin: 'java'
sourceCompatibility = 1.6
targetCompatibility = 1.6

I've also found on this answer that the actual class versions can be the problem. Given that you have version 0034.0000 in your title, this is more likely your issue.

From the other answer:

The version must be between 45-50 (major version) The version you're using here is 0033.0000 (0x33 in hex), which is 51 in decimal (the version number representing Java 7)

You should make sure your build tools are up to date in the SDK manager and recompile your library with Java 5 or 6 to avoid the issue

Community
  • 1
  • 1
Nick Cardoso
  • 20,807
  • 14
  • 73
  • 124
  • No problem, welcome to SO. If this answers your question accept it so the question is closed. If it doesn't, its fine to add your own answer so that future visitors can see what solves the issue. – Nick Cardoso Apr 09 '16 at 17:33