I've had an issue in the release build where some ...
# compose-android
j
I've had an issue in the release build where some animations in were not happening in compose navigation (popEnter all the time and sometimes enter) . The screen would just instantly appear after the exiting screen animates out correctly. Eventually I narrowed it down to this proguard rule fixing it: (after binary searching down to
-keep class androidx.compose.ui.platform.AndroidComposeView { *; }
)
Copy code
-keepnames class androidx.compose.ui.platform.AndroidComposeView { *; }
I'm curious why this fixes it and if having this rule would adversely affect performance of Compose in general? (I'm guessing there's some type check in the animation library that fails, but then not sure why r8/the minify setup wouldn't account for that? I've only being doing Android for a few months and this is the first issue with minifying I've come across)
i
Have you filed an issue for this? You shouldn't need ProGuard rules to get animations to work. cc @Doris Liu
j
No, I can do though, just it seemed more like I was doing something wrong than it being an issue?
i've found that if the composable that causes the navigation has a
clickable
Modifier with
indication = null
(to not have the ripple effect) then that breaks the animation (still only in release mode). As in if I remove the
indication = null
, then the animation works correctly without the proguard rule. Which is thoroughly confusing to me why that would have an effect. If I do some navigation afterwards with a clickable modifier without the indication being null then all the animations work as expected from that point on.
i
Both of those fixes are so far away from animations that you should definitely file a bug with a sample project that reproduces it in release mode
j
Yeah it's weird, I've tried making a sample, but can't reproduce it so trying to find what else is going on. I'll file a bug after finding out though