0

"asm-4.0.jar", "org.objectweb.asm", if this .jar is included, I get this error, while building:

AGPBI: {"kind":"error","text":"Uncaught translation error: com.android.dx.cf.code.SimException: com.android.dx.rop.cst.CstMethodRef cannot be cast to com.android.dx.rop.cst.CstInterfaceMethodRef","sources":[{}]}
AGPBI: {"kind":"error","text":"Uncaught translation error: com.android.dx.cf.code.SimException: com.android.dx.rop.cst.CstMethodRef cannot be cast to com.android.dx.rop.cst.CstInterfaceMethodRef","sources":[{}]}
AGPBI: {"kind":"error","text":"Uncaught translation error: com.android.dx.cf.code.SimException: com.android.dx.rop.cst.CstMethodRef cannot be cast to com.android.dx.rop.cst.CstInterfaceMethodRef","sources":[{}]}
AGPBI: {"kind":"error","text":"Uncaught translation error: com.android.dx.cf.code.SimException: com.android.dx.rop.cst.CstMethodRef cannot be cast to com.android.dx.rop.cst.CstInterfaceMethodRef","sources":[{}]}
AGPBI: {"kind":"error","text":"4 errors; aborting","sources":[{}]}

Some part from Proguard config:

#-libraryjars libs/asm-4.0.jar
-keep class !org.objectweb.asm.** { *; }
-dontwarn org.objectweb.asm.**

Full proguard config: http://pastebin.com/mxXK4WvY

-dontobfuscate

This line makes proguard work, but I need obfuscation.

What should I do? This jar is needed for Kryonet, my whole game is built on it.

Gintas_
  • 4,940
  • 12
  • 44
  • 87
  • 2
    Uhm that "!" looks wrong. – rekire Apr 26 '16 at 20:35
  • @rekire but if I remove it, nothing changes, still does not work – Gintas_ Apr 26 '16 at 20:35
  • 1
    I just reviewed your proguard file. It is the longest one I have ever seen. Are you sure that just that four lines causes the problem? You could check with [jadx](https://github.com/skylot/jadx) the content of your apk file to check which classes where removed. – rekire Apr 26 '16 at 20:45
  • @rekire I think I'm sure, because if I remove this jar, it builds fine. But it is however needed because it's referenced in other jars as I see. – Gintas_ Apr 26 '16 at 20:49

1 Answers1

0

I think I fixed it by making it like this:

-keep class org.objectweb.asm.** { *; }
-keepclassmembers class org.objectweb.asm.** { *; }
-keepclassmembernames class org.objectweb.asm.** { *; }
-dontwarn org.objectweb.asm.**
Gintas_
  • 4,940
  • 12
  • 44
  • 87