Proguard - Can't find common super class / java.lang.VerifyError

后端 未结 4 1633
梦如初夏
梦如初夏 2021-01-04 00:58

We are developing a desktop application. When running ProGuard (version 5.3.3) on the code using the following configuration flags:

-dontoptimize
-allowacces         


        
4条回答
  •  旧巷少年郎
    2021-01-04 01:16

    Troubleshooting

    ProGuard may print out some notes and non-fatal warnings:

    Note: can't find dynamically referenced class ProGuard can't find a class or interface that your code is accessing by means of introspection. You should check if you want to add the jar that contains this class.

    Note: ... calls '(...)Class.forName(variable).newInstance()' ProGuard lists all class casts of dynamically created class instances, like "(MyClass)Class.forName(variable).newInstance()". Depending on your application, you may need to keep the mentioned classes with an option like -keep class MyClass, or their implementations with an option like -keep class * implements MyClass. You can switch off these notes by specifying the -dontnote option.

    Note: ... accesses a field/method '...' dynamically ProGuard lists a number of constructs like ".getField("myField")". Depending on your application, you may need to figure out where the mentioned class members are defined and keep them with an option like -keep class MyClass { MyFieldType myField; }. Otherwise, ProGuard might remove or obfuscate the class members, since it can't know which ones they are exactly. It does list possible candidates, for your information. You can switch off these notes by specifying the -dontnote option.

提交回复
热议问题