From 72a291d0c0e426936af109fd1883538629e505d0 Mon Sep 17 00:00:00 2001 From: freetlab Date: Fri, 7 Aug 2026 00:24:18 +0200 Subject: [PATCH] fix(ci): clean before building so new Android resources reach the APK The equalizer drawables were never in the shipped binary. Verified by pulling base.apk off the device and reading it: res/drawable/ic_stat_pluriwave.xml PRESENT (added 02-07) res/drawable/ic_auto_eq_on.xml ABSENT (added 31-07, 2540556) res/drawable/ic_auto_eq_off.xml ABSENT Neither as a zip entry nor as a name in resources.arsc. Both files are in git with content and on disk; the older sibling in the same folder is in the APK. The difference is when they were added. This runner is self-hosted and the workflow never cleaned, so build/ survives between runs and Gradle's incremental resource merge went stale: resources present when the cache was built kept working, resources added afterwards silently never made it in. The cost was weeks of wrong diagnosis. getResourceId returned 0 for that icon, PlaybackStateCompat.CustomAction.Builder throws on a 0 icon, and that throw aborts AudioService.setState BEFORE mediaSession.setActive -- so Android Auto held a frozen, inactive session. On the device that surfaced as a dead playback screen, a play button that never became pause, PluriWave losing its pane to whichever app did have an active session, and audio that played "as if it were not the app". One cause, four symptoms. Dart changes always shipped because Dart is recompiled every build, which is exactly why this hid for so long: every fix appeared to land and nothing behaved differently. flutter clean costs build time. It buys the guarantee that what is in git is what is in the binary, which this project just spent weeks not having. --- .gitea/workflows/build.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 687cd6a..438372c 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -109,6 +109,28 @@ jobs: - name: Obtener dependencias run: flutter pub get + # OBLIGATORIO en este runner autoalojado, no es higiene opcional. + # + # El directorio build/ sobrevive entre ejecuciones y el merge + # incremental de recursos de Gradle se queda rancio: los drawables + # ic_auto_eq_on/ic_auto_eq_off (anadidos el 31-07 en 2540556) NUNCA + # llegaron a entrar en el APK, mientras que ic_stat_pluriwave -- misma + # carpeta, anadido el 02-07 -- si estaba. Verificado extrayendo el + # base.apk instalado en el dispositivo: los ficheros no existen ni como + # entrada del zip ni en resources.arsc. + # + # El coste fue semanas de diagnostico equivocado. Cada setState + # publicaba una CustomAction cuyo icono resolvia a 0, y + # PlaybackStateCompat.CustomAction.Builder lanza en ese caso, abortando + # setState antes de activar la sesion de medios: Android Auto se + # quedaba con la sesion congelada e inactiva. El codigo Dart siempre + # llegaba porque se recompila; el recurso Android no. + - name: Limpiar artefactos de compilacion + run: flutter clean + + - name: Reinstalar dependencias tras limpiar + run: flutter pub get + - name: Build APK release run: flutter build apk --release