VladoS24
VladoS24

Reputation: 45

Proguard warning with [java/lang/String]

I'm facing issue with proguard. I've some rules in proguard and one of them is:

-keep class org.jmrtd.** { *; }
-dontwarn org.jmrtd.**

But I've getting this warning when building

Unexpected error while performing partial evaluation:
  Class       = [org/jmrtd/MRTDFileSystem]
  Method      = [readBinary(II)[B]
  Exception   = [java.lang.IllegalArgumentException] (Can't find common super class of [java/lang/String] (with 2 known super classes) and [org/jmrtd/MRTDFileSystem$MRTDFileInfo] (with 1 known super classes))
Unexpected error while preverifying:
  Class       = [org/jmrtd/MRTDFileSystem]
  Method      = [readBinary(II)[B]
  Exception   = [java.lang.IllegalArgumentException] (Can't find common super class of [java/lang/String] (with 2 known super classes) and [org/jmrtd/MRTDFileSystem$MRTDFileInfo] (with 1 known super classes))

Can anybody help me? Thank you.

Upvotes: 0

Views: 954

Answers (1)

Shailesh Chandra
Shailesh Chandra

Reputation: 2340

It looks like a problem with library jar. Are you sure all libraries is configured properly? MRTDFileInfo is an inner class of MRTDFileSystem, which might be referenced internally.

The processing steps are as follows:

Input Jar --> Strink --> Optimize --> Obfuscate --> Preverify --> output jar

Based on your error trace you are getting an error during the Preverify step: Unexpected error while preverifying

If you want to skip this erorr you can simply use prevent Proguard from preverifying:

-dontpreverify

It will skip preverifying, but I doubt that the jar will run properly

I would suggest you provide your library jars correctly , so that proguard can refer them.

Also apart from -dontwarn , you can also use -ignorewarnings

hope this help in debugging issue.

Upvotes: 1

Related Questions