I spent the whole weekend to make my Compose multi...
# compose-desktop
m
I spent the whole weekend to make my Compose multiplatform code working with Kotlin 2.0.0. After several individual troubles I finally got the code working in the IDE. But in the end I found that I could not make a release build of my desktop app because ProGuard does not seem to like the new code generated by Kotlin 2.0.0. The build fails with the message:
Copy code
Warning: there were 668 classes in incorrectly named files.
         You should make sure all file names correspond to their class names.
         The directory hierarchies must correspond to the package hierarchies.
         (<https://www.guardsquare.com/proguard/manual/troubleshooting#unexpectedclass>)
         If you don't mind the mentioned classes not being written out,
         you could try your luck using the '-ignorewarnings' option.
Unexpected error
java.io.IOException: Please correct the above warnings first.
The individual warnings where all like this:
Copy code
Encountered corrupt @kotlin/Metadata for class de/mpmediasoft/mpdocview/compose/Document (version 2.0.0).
Has anybody noticed that before and how should one proceed now? This whole code works perfectly and if generated with Kotlin 1.9.23 ProGuard also does not have a problem with it like this.
👀 1
e
👀 1
🙏 1
m
You seem to be right. Thanks a lot for the hint. See also: https://github.com/Guardsquare/proguard/issues/376 But the sad point is that this version does not seem to be publicly available yet.
a
You can temporarily clone ProGuard, build it and publish to maven local and use it, Compose desktop use Proguard 7.2.2 Or maybe fork it, publish it to Jitpack and use it, add a
TODO
so you use the original one from maven central later
j
ProGuard 7.5 has now been released 🚀
K 3
m
Mission accomplished! I just recompiled all my libraries and built a release of the first app with K2 and ProGuards 7.5. Everything worked like a charm. Thanks a lot @James Hamilton. 🚀
🥳 1