EvalEx icon indicating copy to clipboard operation
EvalEx copied to clipboard

Version 3.4.0 doesn't work with proguard

Open uklimaschewski opened this issue 10 months ago • 2 comments

@uklimaschewski Has reflection or something runtime related been added in the last versions? Version 3.4.0 no longer works on Android when using R8 (Code shrinking), if so we should also add the proper rules such that R8 knows what can be shrinked/removed and what not. My workaround for now is to -keep class com.ezylang.evalex.** { *; } but this is way to much.

Originally posted by @vanniktech in #391

uklimaschewski avatar Feb 16 '25 09:02 uklimaschewski

@vanniktech I do not use proguard and my knowledge about is limited. Can you give some more hints or clues on how to solve this? E.g. what version was the last one where it was working? SO I could have a look at the changes. Or do you already have a solution on what to add to the configuration, so that it works again?

uklimaschewski avatar Feb 16 '25 10:02 uklimaschewski

E.g. what version was the last one where it was working?

I don't remember it.

Or do you already have a solution on what to add to the configuration, so that it works again?

I only have the workaround of excluding everything but that's way too much.


Proguard/R8 essentially removes all the code that's unused. So as long as there are no references, things get removed. This works fabulously, until you use Java's Reflection API at Runtime. Proguard/R8 can't see them and therefore specific rules need to written such that the code isn't removed and still available via Reflection. Does EvalEx have any reflection code?

vanniktech avatar Feb 16 '25 10:02 vanniktech