Menu

#228 VerifyError

closed-works-for-me
None
6
2007-08-28
2007-08-08
aditsu
No

See the attached zip.
The original jar works; the processed jar throws:
Exception in thread "main" java.lang.VerifyError: (class: tst/a, method: <init> signature: (Ljava/lang/Class;)V) Incompatible object argument for function call
at tst.Tst.main(Unknown Source)

Discussion

  • aditsu

    aditsu - 2007-08-08
     
  • Eric Lafortune

    Eric Lafortune - 2007-08-08
    • priority: 5 --> 6
    • assigned_to: nobody --> lafortune
     
  • Eric Lafortune

    Eric Lafortune - 2007-08-08

    Logged In: YES
    user_id=555208
    Originator: NO

    Thanks for the report. I can reproduce it, and I'll investigate further.

     
  • Eric Lafortune

    Eric Lafortune - 2007-08-09

    Logged In: YES
    user_id=555208
    Originator: NO

    Did you compile the code with the Eclipse compiler? It contains some slightly dubious bytecode. Admittedly, the JVM accepts it and executes it correctly. When compiled with Sun's javac, the code looks better, and ProGuard can handle it fine.

     
  • aditsu

    aditsu - 2007-08-09

    Logged In: YES
    user_id=682737
    Originator: YES

    Yes, it's compiled by Eclipse. Is it just dubious or really incorrect (but accepted by the lenient jvm)?
    Either way, I hope proguard can handle it.

     
  • Eric Lafortune

    Eric Lafortune - 2007-08-24

    Logged In: YES
    user_id=555208
    Originator: NO

    Which version of the Eclipse compiler did you use? The problem seems to have been solved in the most recent version. In that case, I won't try to work around it in ProGuard.

     
  • aditsu

    aditsu - 2007-08-27

    Logged In: YES
    user_id=682737
    Originator: YES

    I was using eclipse 3.2.
    I tried with 3.3 now, and I'm getting:

    Exception in thread "main" java.lang.NullPointerException
    at tst.a.<init>(Unknown Source)
    at tst.Tst.main(Unknown Source)

     
  • Eric Lafortune

    Eric Lafortune - 2007-08-27

    Logged In: YES
    user_id=555208
    Originator: NO

    You mustn't forget to keep the special Enumeration methods (cfr. ProGuard Manual -> Examples -> Processing enumeration classes):

    -keepclassmembers class * extends java.lang.Enum {
    public static **[] values();
    public static ** valueOf(java.lang.String);
    }

     
  • aditsu

    aditsu - 2007-08-28

    Logged In: YES
    user_id=682737
    Originator: YES

    Oh, you're right, that got lost in the process of reducing to a minimal example.
    It works now, thanks for the help.

     
  • aditsu

    aditsu - 2007-08-28
    • status: open --> closed-works-for-me
     

Log in to post a comment.