Menu

#633 Unexpected error while performing partial evaluation

v5.3.2
open-works-for-me
nobody
None
5
2017-01-15
2016-12-31
Shai Cohen
No

Hello,
im tring to run proguard on my code but im always getting errors
now it's

 ProGuard, version 5.3.2
 Reading program jar [C:\Users\program.jar] (filtered)
 Reading library jar [C:\Program Files\Java\jre1.8.0_111\lib\rt.jar]
 Reading library jar [C:\Program Files\Java\jre1.8.0_111\lib\jsse.jar]
 Reading library jar [C:\Program Files\Java\jre1.8.0_111\lib\ext\jfxrt.jar]
 Reading library jar [C:\Program Files\Java\jre1.8.0_111\lib\javaws.jar]
Reading library jar [C:\Program Files\Java\jre1.8.0_111\lib\jce.jar]
 Unexpected error while performing partial evaluation:
   Class       = [ch/qos/logback/core/status/ViewStatusMessagesServletBase]
   Method      = [printList(Ljava/lang/StringBuilder;Lch/qos/logback/core/status/StatusManager;)V]
   Exception   = [java.lang.IllegalArgumentException] (Can't find common super class of [ch/qos/logback/core/status/ViewStatusMessagesServletBase] (with 1 known uper classes) and [java/lang/StringBuilder] (with 3 known super classes))
 Error: Can't find common super class of [ch/qos/logback/core/status/ViewStatusMessagesServletBase] (with 1 known super classes) and [java/lang/StringBuilder] (with 3 known super classes)

tried many things.
this is my config file after many changes:

-libraryjars "<java.home>/lib/rt.jar"
-libraryjars "<java.home>/lib/jsse.jar"
-libraryjars "<java.home>/lib/ext/jfxrt.jar"
-libraryjars "<java.home>/lib/javaws.jar"
-libraryjars "<java.home>/lib/jce.jar"  


-injars  program.jar(!proguard/ant/**,!proguard/gradle/**,!proguard/wtk/**)
-outjars pro_program.jar

-classobfuscationdictionary obfuscationClassNames.txt
-dontshrink
-printmapping "Maping function to function.map"
-target 8

-optimizations !class/unboxing/enum

-dontskipnonpubliclibraryclassmembers
-dontskipnonpubliclibraryclass

-dontobfuscate

-dontpreverify
-dontnote **
-repackageclasses
-flattenpackagehierarchy ''
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,LocalVariable*Table,*Annotation*,Synthetic,EnclosingMethod,EventHandler,Override
-adaptresourcefilecontents **.fxml,**.properties,META-INF/MANIFEST.MF

-keepclasseswithmembers public class application.Main {
    public static void main(java.lang.String[]);
}

-keepclassmembernames class * {
    @javafx.fxml.FXML *;
}

# Don't obfuscate or remove your entry point
-keep public class application.Main {
    public static void main(java.lang.String[]);
    public void start(javafx.stage.Stage);
}
-keepclassmembers public class dps.** {
    public javafx.beans.property.SimpleStringProperty *Property();

}

-keepclassmembers class * {
    private static synthetic java.lang.Object $deserializeLambda$(java.lang.invoke.SerializedLambda);
}

-keep class java.lang.StringBuilder { *; }
-keep class dps.utils.gui.MyTableView { *; }

-keep class javax.crypto.** { *; }
-keep class org.apache.commons.logging.** { *; }
-keep class dps.application.** { *; }
-keep class com.** { *; }
-keep class lynden.gmapsfx.** { *; }
-keep class POGOProtos.** { *; }
-keep class okhttp3.** { *; }
-keep class svarzee.** { *; }
-keep class org.slf4j.** { *; }
-keep class org.apache.* { *; }
-keep interface org.apache.**

##############################################################################
##############################################################################
##############################################################################
-dontwarn org.joda.convert.**
-dontwarn com.google.**
-dontwarn dps.utils.cypher.Cypher
-dontwarn org.apache.**
-dontwarn com.squareup.**
-dontwarn okhttp3.internal.**
-dontwarn okio.**
-dontwarn ch.qos.logback.**
-dontwarn org.slf4j.**

i don't know where i'm wrong.
please help.
thanks

Discussion

  • Shai Cohen

    Shai Cohen - 2016-12-31

    BTW,
    removing -optimization... will cause proguard to finished it's job but when running the output jar Im receiving that error:

    Caused by: java.lang.VerifyError: Expecting a stackmap frame at branch target 31
    Exception Details:
      Location:
        org/json/simple/parser/JSONParser.nextToken()V @15: ifnonnull
      Reason:
        Expected stackmap frame at this location.
      Bytecode:
        0x0000000: 2a2a b400 05b6 002a b500 062a b400 06c7
        0x0000010: 0010 2abb 002b 5902 01b7 002c b500 06b1
        0x0000020:
    
            at dps.utils.json.JSONReader.readJSON(JSONReader.java:30)
            at application.Main.start(Main.java:47)
            at application.Main.main(Main.java:31)
            ... 11 more
    Exception running application application.Main
    
     

    Last edit: Shai Cohen 2016-12-31
  • Eric Lafortune

    Eric Lafortune - 2017-01-15

    You're suppressing warnings about unresoved references with -dontwarn, notably for ch.qos.logback. This can cause problems while processing the code. You should try removing this line and solve the reported issue instead. The Logback library depends on some other library (maybe the servlet library) that is missing. The resulting unresolved reference hinders a proper analysis in the optimization step.

    Alternatively, you could try filtering out the offending Logback class from the input.

    Alternatively, you could try to enable the shrinking step, so classes with unresolved references are (hopefully) removed before the optimization step.

     
  • Eric Lafortune

    Eric Lafortune - 2017-01-15
    • status: open --> open-works-for-me
     

Log in to post a comment.

MongoDB Logo MongoDB