Error Proguard不支持的类版本号 [英] Error Proguard Unsupported class version number
问题描述
当我尝试使用proguard混淆app时,我总是遇到这种错误
I get always this erroe when I try to obfuscate an App with proguard
Error:ProGuard: [MyApp] java.io.IOException: Can't read [C:\Program Files\Java\jdk1.8.0\jre\lib\rt.jar] (Can't process class [com/oracle/net/Sdp$1.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7)))
I已经更新了Proguard并检查了项目配置文件,但始终是相同的错误。我正在使用最新版本的Intellij IDEA
I have already updated Proguard and checked the project-config file but always the same Error. I'm using the latest version of Intellij IDEA
推荐答案
似乎Proguard实际上不支持Java 8。您必须使用JDK版本7.
Seems that Proguard doesn't support Java 8 actually. You have to use JDK version 7.
EDIT-1
我重新编译了Proguard以支持JDK 8类,不支持Java 8新功能,但如果您的代码不使用Java 8新语法(例如Lambda Expression)应该没有问题。测试了一些Android项目。
I have recompiled Proguard to support JDK 8 classes, doesn't support Java 8 new features but if your code doesn't use Java 8 new syntax(e.g. Lambda Expression) should works without problems. Tested with some android projects.
使用替换文件proguard.jar
To use replace the file proguard.jar in
android-sdk\tools\proguard\
内容此档案
编辑-2
最近已经发布了应该解决这个问题的官方Proguard 5。您可以从 HERE
Recently has been released the official Proguard 5 that should address the issue. You can download this from HERE
这篇关于Error Proguard不支持的类版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!