android studio 2.3.0 打包编译问题

问题:

Dex: 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.

    UNEXPECTED TOP-LEVEL EXCEPTION:

    java.lang.RuntimeException: Exception parsing classes

        at com.android.dx.command.dexer.Main.processClass(Main.java:781)

        at com.android.dx.command.dexer.Main.processFileBytes(Main.java:747)

        at com.android.dx.command.dexer.Main.access$1200(Main.java:88)

        at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1689)

        at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)

        at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)

        at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)

        at com.android.dx.command.dexer.Main.processOne(Main.java:695)

        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:587)

        at com.android.dx.command.dexer.Main.runMultiDex(Main.java:376)

        at com.android.dx.command.dexer.Main.run(Main.java:290)

        at com.android.builder.internal.compiler.DexWrapper.run(DexWrapper.java:54)

        at com.android.builder.core.DexByteCodeConverter.lambda$dexInProcess$0(DexByteCodeConverter.java:174)

        at java.util.concurrent.FutureTask.run(FutureTask.java:266)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

        at java.lang.Thread.run(Thread.java:745)

    Caused by: com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)

        at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:476)

        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.parseClass(Main.java:793)

        at com.android.dx.command.dexer.Main.access$1600(Main.java:88)

        at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1728)

        at com.android.dx.command.dexer.Main.processClass(Main.java:779)

        ... 16 more

1 error; aborting

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process

网上查找都是改jdk版本等  在我这里都解决不了。。。

我的解决方式:提高Android studio 版本到 3.0.1   

你可能感兴趣的:(android studio 2.3.0 打包编译问题)