Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
588 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 Answer

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...