Execution failed for task: ':app:preDexDebug'

我只是一个虾纸丫 提交于 2019-12-01 03:49:55

Solved it.

What confused me: The output com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)","position":{},"original":"com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)" let me think, that the error comes out of some android libraries, because every JDK-setting was set to 1.7.

But I knew that somewhere Java 8 was used. It was really strange to me.

Solution: Even though the permament notify of using --stacktrace or --debug was shown, I did not know where to use them (it was not explained anywhere). After searching the settings I stumbled upon the textfield for this options. So I wrote "--debug" in it. This option gave me information about, what really causes the error. Thanks to the debug-mode the title of the library was given, which caused the error by using Java 8. Since Eclipse doesn't complain about that, nobody in my company took care of this. What let me think in return, that everything had to be correct.

To make things short: If you are experiencing errors, like many people before, but their solutions don't work or your case seems to be very special, just use "--debug". The true informations are hidden there.

To add --debug (or--stacktrace) go to File .. Settings ..Build, Execution, Deploy .. Compiler .. Command Line Arguments

Go to File > Other Settings> default Settings >Build, Execution, Deploy> Complier and add the following arguments to Command Line Arguments

--debug --stacktrace 

I had same problem.

For me works: buildToolsVersion '21.1.2' It shown AGPBI as warning, but it's still possible compile.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!