Has anyone else had trouble with their Compose app...
# compose
f
Has anyone else had trouble with their Compose app crashing on release builds with R8 enabled? Running into a weird crash on one of the screens in my app that seems to be related to the number of composables being drawn on screen at once. For example, if I comment out a few of my composables on that screen, the crash doesn't occur (doesn't matter which ones I comment out). Happens on both 1.1.1 and 1.2.0-rc02. Are there any ProGuard / R8 rules specific to Compose that I'm missing?
App still crashes after adding
-keep class androidx.compose.runtime.** { *; }
to my ProGuard rules, but at least I get an unobfuscated stack trace now. I guess my next question is, what else would cause a Compose app to behave differently between a debug and release build that would result in a crash like this?
Definitely not an R8 issue as the crash still occurs on a release build with minification turned off ¯\_(ツ)_/¯
c
I feel like ive seen a couple of bugreports in issuetracker about this. I can try to search when im back at my desk.
👍 1
f
Ok, I just solved the issue, though I don't exactly know why. This results in a crash on release builds:
Copy code
Box {
    if (data == null) {
        // ...
        return@Box
    }

    // ...
}
But this works fine:
Copy code
Box {
    if (data == null) {
        // ...
    } else {
        // ...
    }
}
😭 1
c
Seems like it's worth filling a bug
f
I'll see if I can get a repro project spun up then file a bug
❤️ 1
m
I have experienced the same bug and came to the conclusion not to trust return@Someting to go around null params. If-else always works
👍 1