From dea364dd172bc3405f7dc76bda7ffb6caf7a695f Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Wed, 15 Apr 2026 09:30:33 -0500 Subject: [PATCH] fix(app): add R8 keep rules for Compose animation/runtime/ui (#5146) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- app/proguard-rules.pro | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 190d9b891..8340fdd10 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -39,6 +39,22 @@ # replacing Koin's InstanceCreationException in stack traces, making crashes undiagnosable). -keep class org.koin.core.error.** { *; } +# ---- Compose Runtime & Animation -------------------------------------------- + +# R8's optimization passes (bundled with AGP 9.x) can inline and dead-code- +# eliminate parts of the Compose frame-clock / recomposer / animation state +# machines, causing every animation to silently freeze on its first frame in +# release builds — indeterminate progress spinners, crossfade transitions, +# animateFloatAsState, AnimatedVisibility, etc. +# +# The frame clock lives in compose.runtime, the draw loop in compose.ui, +# and the animation drivers in compose.animation.core. Keep all three so +# R8 does not break the chain. +-keep class androidx.compose.runtime.** { *; } +-keep class androidx.compose.ui.** { *; } +-keep class androidx.compose.animation.core.** { *; } +-keep class androidx.compose.animation.** { *; } + # ---- Compose Multiplatform -------------------------------------------------- # Keep resource library internals and generated Res accessor classes so R8 does