Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
584 views
in Technique[技术] by (71.8m points)

android - Error Proguard Unsupported class version number

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 FilesJavajdk1.8.0jrelib
t.jar] (Can't process class [com/oracle/net/Sdp$1.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7)))

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Seems that Proguard doesn't support Java 8 actually. You have to use JDK version 7.

EDIT-1

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.

To use replace the file proguard.jar in

android-sdkoolsproguard 

with the content of THIS ARCHIVE

EDIT-2

Recently has been released the official Proguard 5 that should address the issue. You can download this from HERE


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...