Does anyone have R8 working for desktop? I keep ru...
# compose-desktop
s
Does anyone have R8 working for desktop? I keep running into weird issues with ProGuard on desktop that I don't have on Android.
m
Because on Android proguard files/rules for libraries that your app depends on are automatically included in your packaged executable but this is not the case on desktop. you have to add your own rules + rules from libraries your app depends on, so, it is more painful process. Take a look at this article in which the author shares his experience reducing desktop app size with proguard: https://medium.com/@mike_21858/using-proguard-with-jetpack-compose-desktop-size-reduction-performance-gains-and-pain-481a014c6b0a and previous discussion about this topic: https://kotlinlang.slack.com/archives/C01D6HTPATV/p1706222701453489
s
I think my issues are more related to bugs in ProGuard. R8 seems to handle sealed interfaces better. I need to add rules for my own data structures for desktop that I don't need to add on Android.
m
https://kotlinlang.slack.com/archives/C01D6HTPATV/p1702294616584159 Also my thread where I eventually succeeded and shared my config
s
That appears to be using ProGuard.
m
That’s right. Isn’t R8 Android specific? I didn’t know you can use R8 on desktop.
s
A few people have mentioned an intention to use R8. https://github.com/JetBrains/compose-multiplatform/issues/1604