This is probably a shot in the dark, but hoping to...
# jvm-ir-backend-feedback
j
This is probably a shot in the dark, but hoping to get some guidance on where to start. I have a plugin into a android map app written in java but the plugin is 100% kotlin. After updating to kotlin 1.5, everything worked fine in debug but in release with obfuscation, got an abstract method error crash. Long story short, setting useoldjvmbackend to true fixes the issue. It would probably be hard to provide a sample repo for this scenario since it's a plugin to a java map app,but I could see someslight differences in the mapping.txt file when using the old jvm backend and the new one. Production wise, can move forward with using 1.5 but sucks to not be able to realize all the improvements the team is making with the new IR.
u
We've fixed plenty of issues in the JVM IR backend in the subsequent 1.5.x releases, be sure to check out 1.5.20, and also 1.5.30-M1 a bit later soon when it's ready. If the issue is still there, it would be awesome if we could have a reproducible test case (doesn't have to be fully minimized). We're going to deprecate the old JVM backend in 1.6 and remove it in a future release, so it's important to make sure everyone is able to migrate to the new backend.
j
It's still an issue with 1.5.20. I'll check out 1.5.30 today. Thanks
Just reread your post. I'll check it out with 1.5.30 as soon as it drops
UPDATE - If we use obfuscation with the new jvm backend, on 1.5, 1.6.21, and 1.7, app crashes with AbstractMethodError. I'm assuming there is some kind of proguard keep we need to do but not having any luck googling. I looked at the mapping file with proguard. Looks like the old backend generated an instance of a class which includes the proguard obfuscated names from the Java app that consumes our code. With the new backend, see that it is using a lambda and not sure what it means. Is there any way to configure the backend to not use lambdas for SAMS? Or can someone point me to some sort of proguard docs to try to figure out how to make proguard happy?
u
Not sure if I understand what you're asking, but if you're looking for a way to generate anonymous subclasses for SAM adapter lambdas like the old backend did (instead of
invokedynamic
), please try adding the compiler argument
-Xsam-conversions=class
j
My man. Thanks I'll try that.
Trying to find the magic proguard statement for this has proved maddening