fix(android): move MainActivity to the package the manifest looks for
Build & Deploy Farolero / Análisis de código (push) Successful in 14s
Build & Deploy Farolero / Build APK + AAB release (push) Successful in 1m28s

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.
This commit is contained in:
2026-07-25 23:26:32 +02:00
parent c15a5e31cb
commit 586b60ae78
2 changed files with 7 additions and 1 deletions
@@ -1,4 +1,4 @@
package es.freetimelab.farolero package es.freetimelab.farolero.game
import io.flutter.embedding.android.FlutterActivity import io.flutter.embedding.android.FlutterActivity
+6
View File
@@ -15,6 +15,12 @@ import 'pantallas/pantalla_principal.dart';
void main() { void main() {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); 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( SystemChrome.setSystemUIOverlayStyle(
const SystemUiOverlayStyle( const SystemUiOverlayStyle(
statusBarColor: Colors.transparent, statusBarColor: Colors.transparent,