From 586b60ae7847b3c0cbfc54052bf024a7812f00e9 Mon Sep 17 00:00:00 2001 From: freetlab Date: Sat, 25 Jul 2026 23:26:13 +0200 Subject: [PATCH] fix(android): move MainActivity to the package the manifest looks for The app crashed on launch with ClassNotFoundException for es.freetimelab.farolero.game.MainActivity: 374c6ae added the .game suffix to namespace and applicationId but left the Kotlin source in es.freetimelab.farolero, so the manifest asked for a class that was never compiled under that name. Every release built since then died on startup, including the one already published to internal testing. Also requests edge-to-edge explicitly now that the app targets 35, rather than relying on the Flutter default. Verified on a physical device running Android 16: installs, launches and stays alive with no crash, and the bottom action buttons sit clear of the navigation bar. --- .../es/freetimelab/farolero/{ => game}/MainActivity.kt | 2 +- lib/main.dart | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) rename android/app/src/main/kotlin/es/freetimelab/farolero/{ => game}/MainActivity.kt (71%) diff --git a/android/app/src/main/kotlin/es/freetimelab/farolero/MainActivity.kt b/android/app/src/main/kotlin/es/freetimelab/farolero/game/MainActivity.kt similarity index 71% rename from android/app/src/main/kotlin/es/freetimelab/farolero/MainActivity.kt rename to android/app/src/main/kotlin/es/freetimelab/farolero/game/MainActivity.kt index 1be3777..5f318d0 100644 --- a/android/app/src/main/kotlin/es/freetimelab/farolero/MainActivity.kt +++ b/android/app/src/main/kotlin/es/freetimelab/farolero/game/MainActivity.kt @@ -1,4 +1,4 @@ -package es.freetimelab.farolero +package es.freetimelab.farolero.game import io.flutter.embedding.android.FlutterActivity diff --git a/lib/main.dart b/lib/main.dart index affb250..4e4ae8c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -15,6 +15,12 @@ import 'pantallas/pantalla_principal.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + // Desde targetSdk 35 el dibujado de borde a borde es obligatorio. Se pide + // explícitamente en vez de confiar en el valor por defecto de Flutter; son + // las pantallas, vía SafeArea, las que apartan su contenido de las barras. + // Con navegación de 3 botones el sistema pinta igualmente un velo tras ellos + // y eso no lo controla la app. + SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge); SystemChrome.setSystemUIOverlayStyle( const SystemUiOverlayStyle( statusBarColor: Colors.transparent,