-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VerifyError with Compose Multiplatform project #349
Comments
Hi @AlexeyTsvetkov ! The issue lies in the Firstly, as a work around you can disable this optimization by adding Unfortunately, in your sample this leads to another exception that will need further investigation. The problem: the enum optimization replaces simple enums with integers and the problem occurs in the The original method looks like this:
And the optimized method looks like this:
The values array had been transformed from an enum array Except the next instruction is a method call to This case would normally be handled in
But in the original snippet, the class referenced is This seems to be a difference in the code generated by the Kotlin compiler vs Java compilers. If you compile the following with a Java compiler (
Whereas, if you compile the following with a Kotlin compiler (kotlinc-jvm 1.8.0),
It looks like we'll have to take this into account to be able to correctly apply this optimization to enums generated by |
Similar/same issue with possible "fix". |
ProGuard 7.3.2
Kotlin 1.9.0
Compose Multiplatform 1.5.0-dev1114
JDK Corretto 17.0.5
Reproducer: https://github.com/AlexeyTsvetkov/compose-proguard-optimization-issue
To reproduce:
./gradlew runDistributable
. The app runs normally without ProGuard../gradlew runReleaseDistributable
. The error above is thrown with ProGuard.-dontoptimize
is added tocompose-desktop.pro
, the app runs normally with ProGuard.The configuration file passed to ProGuard can be found here (after
runReleaseDistributable
is run):The ProGuard output jars can be found here (assuming
./gradlew runReleaseDistributable
has run):The non-ProGuard output jars can be found here (assuming
./gradlew runDistributable
has run):The text was updated successfully, but these errors were encountered: