-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
java.lang.VerifyError when running release build #3387
java.lang.VerifyError when running release build #3387
Comments
Just switching back to Kotlin 1.8.22 doesn't make a difference. Only when I also switch back to Compose 1.5.0-dev1103 the release build works again. |
Can you try to disable proguard for |
The problem is reproduced on https://github.com/JetBrains/compose-multiplatform-template |
How do you do that correctly? Might be helpful for other reasons too. |
|
With ProGuard disabled the release build seems to run as it did before. |
Fixes JetBrains/compose-multiplatform#3387 It is probably a bug of proguard, it can't properly inline variables in some cases. ## Test export COMPOSE_CUSTOM_VERSION=46436.333.66 ./gradlew :mpp:publishComposeJbToMavenLocal -Pcompose.platforms=jvm Open https://github.com/JetBrains/compose-multiplatform-desktop-template Insert this code: ``` import androidx.compose.animation.AnimatedVisibility import androidx.compose.material.Text import androidx.compose.ui.window.singleWindowApplication fun main() { singleWindowApplication { AnimatedVisibility(true) { Text("SDg") } } } ``` ./gradlew runReleaseDistributable It runs without crashes after the fix. Before the fix it crashes with the crash: ``` Exception in thread "main" java.lang.VerifyError: Instruction type does not match stack map Exception Details: Location: androidx/compose/animation/AnimatedVisibilityKt.estimateAnimationDurationMillis(FFFFF)J @504: dload ```
Fixes JetBrains/compose-multiplatform#3387 It is probably a bug of proguard, it can't properly inline variables in some cases. ## Test export COMPOSE_CUSTOM_VERSION=46436.333.66 ./gradlew :mpp:publishComposeJbToMavenLocal -Pcompose.platforms=jvm Open https://github.com/JetBrains/compose-multiplatform-desktop-template Insert this code: ``` import androidx.compose.animation.AnimatedVisibility import androidx.compose.material.Text import androidx.compose.ui.window.singleWindowApplication fun main() { singleWindowApplication { AnimatedVisibility(true) { Text("SDg") } } } ``` ./gradlew runReleaseDistributable It runs without crashes after the fix. Before the fix it crashes with the crash: ``` Exception in thread "main" java.lang.VerifyError: Instruction type does not match stack map Exception Details: Location: androidx/compose/animation/AnimatedVisibilityKt.estimateAnimationDurationMillis(FFFFF)J @504: dload ```
* Add DSL flag to control ProGuard's optimizations #3387 * Update default ProGuard version * Revert ProGuard default version to 7.2.2.
The issue report in ProGuard repo Guardsquare/proguard#349 |
In-case useful for anyone with similar issues: instead of disabling ProGuard completely you can disable parts of ProGuard, or specify that specific methods should not be optimized in the ProGuard configuration:
|
…tions. (#706) Fixes JetBrains/compose-multiplatform#3387 It is probably a bug of proguard, it can't properly inline variables in some cases. ## Test export COMPOSE_CUSTOM_VERSION=46436.333.66 ./gradlew :mpp:publishComposeJbToMavenLocal -Pcompose.platforms=jvm Open https://github.com/JetBrains/compose-multiplatform-desktop-template Insert this code: ``` import androidx.compose.animation.AnimatedVisibility import androidx.compose.material.Text import androidx.compose.ui.window.singleWindowApplication fun main() { singleWindowApplication { AnimatedVisibility(true) { Text("SDg") } } } ``` ./gradlew runReleaseDistributable It runs without crashes after the fix. Before the fix it crashes with the crash: ``` Exception in thread "main" java.lang.VerifyError: Instruction type does not match stack map Exception Details: Location: androidx/compose/animation/AnimatedVisibilityKt.estimateAnimationDurationMillis(FFFFF)J @504: dload ```
…tions. (#706) Fixes JetBrains/compose-multiplatform#3387 It is probably a bug of proguard, it can't properly inline variables in some cases. ## Test export COMPOSE_CUSTOM_VERSION=46436.333.66 ./gradlew :mpp:publishComposeJbToMavenLocal -Pcompose.platforms=jvm Open https://github.com/JetBrains/compose-multiplatform-desktop-template Insert this code: ``` import androidx.compose.animation.AnimatedVisibility import androidx.compose.material.Text import androidx.compose.ui.window.singleWindowApplication fun main() { singleWindowApplication { AnimatedVisibility(true) { Text("SDg") } } } ``` ./gradlew runReleaseDistributable It runs without crashes after the fix. Before the fix it crashes with the crash: ``` Exception in thread "main" java.lang.VerifyError: Instruction type does not match stack map Exception Details: Location: androidx/compose/animation/AnimatedVisibilityKt.estimateAnimationDurationMillis(FFFFF)J @504: dload ```
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
Describe the bug
I have just upgraded my Compose multiplatform project (desktop & android) to Kotlin 1.9.0 and Compose 1.5.0-dev1114. This works without problems when I run from the IDE or when I execute the gradle task 'runDistributable'. But when I try to execute 'runReleaseDistributable' the build part works fine too but the program crashes immediately with:
See the full output in the attachment. What I find strange too is that the location is pointing to AnimationSpecKt but the error happens already when I parse the command line parameters of the main program.
This all worked before with Kotlin 1.8.22 and Compose 1.5.0-dev1104.
Affected platforms
Select one of the platforms below:
Versions
To Reproduce
Sorry, no reproducer.
Expected behavior
The release should work the same way as the non-release version.
output.txt.zip
The text was updated successfully, but these errors were encountered: