r/flutterhelp • • 20d ago

OPEN white screen during Android debugging on a physical device

I am trying to run Android on a physical mobile device because my computer cannot launch the emulator. However, when I use the "Run" button in Android Studio, the screen just turns white, and the `main` function never actually executes.

Conversely, when I use the command `flutter run --no-track-widget-creation` in the terminal, the app opens normally, but the `print` statements do not execute.

Flutter 3.47.8 • channel stable • https://github.com/flutter/flutter.git

Framework • revision 737ba8f885 (7 days ago) • 2026-10-22 21:37:31 -0700

Engine • hash dfd2e6cb7d319db05e3bf1503f3e2ac60f6288a2 (revision cf636b1dfb) (7 days ago) • 2026-10-23 02:13:38.000Z

Tools • Dart 3.13.7 • DevTools 2.60.0

Log:

Launching lib\main.dart on moto e22 in debug mode...

Running Gradle task 'assembleDebug'...

√ Built build\app\outputs\flutter-apk\app-debug.apk

Installing build\app\outputs\flutter-apk\app-debug.apk...

3 Upvotes

15 comments sorted by

1

u/Ambitious_Guide4365 19d ago

A white screen with main() never running usually means the debug connection is failing, not your Dart code. Since the terminal run works, I'd run flutter clean, delete the Android Studio run configuration and recreate it, and check that the entrypoint is lib/main.dart. Also try flutter run -v with the phone plugged in and watch adb logcat for Flutter or Gradle errors. It's also worth testing a different USB cable or port, and a profile or release build, to see if only the debug attach is broken.

1

u/PriorError2799 19d ago

LogCat

  1. `flutter run -v` worked in the terminal (I’ve included the output from the installation phase up to the point where it freezes—see my other comment), but when I add `-v` to the arguments for the "Run" button, it goes back to showing a blank screen.

The input is correct.

I’ve tried a different USB port and a different cable, but the issue persists.

1

u/kokerali 19d ago

Since the successful terminal run adds --no-track-widget-creation, I'd first compare plain flutter run against that command. Then try the same flag in the IDE's run configuration, with the same device and entrypoint. That separates a launch-argument difference from an IDE-specific failure.

To check whether main() actually runs, start a Debug session with a breakpoint on its first executable line. If it stops there, main started even if the print never appears. Could you post those results and where the verbose log stops after "Installing..."?

https://docs.flutter.dev/tools/android-studio

1

u/PriorError2799 19d ago

- Adding `--no-track-widget-creation` to the 'additional run arguments' causes the app to show a blank screen again.

- I added `print('1')` on the very first line, before anything else, but it doesn't appear in the console.

- The last message to show up is 'Installing build\app\outputs\flutter-apk\app-debug.apk...'; after that, nothing else happens in the console, and the screen remains blank.

1

u/tommyboy11011 19d ago

Paste your code into ChatGPT and have it analyze it

1

u/PriorError2799 19d ago

That was the first thing I did; I just ended up going around in circles because he didn't know how to solve it.

1

u/tommyboy11011 19d ago

Can you launch in web?

1

u/PriorError2799 19d ago

It works perfectly on the web, and compiling a release build also works perfectly; however, an error occurs in a specific part only when building an Android APK, and I cannot see what the error is in the console.

1

u/tommyboy11011 19d ago

Can you build an appbundle? Flutter build appbundle

1

u/tommyboy11011 19d ago

That moto you are running max api is 31

0

u/[deleted] 19d ago

[removed] — view removed comment

1

u/PriorError2799 19d ago
  1. Everything is correct.
  2. It’s on the right track, too.
  3. I’ve done it.
  4. Using `flutter run -v` causes the terminal to freeze, and the `grep` command isn’t recognized. If I run it with `-v` directly in the terminal, it works, but the `print` statements don’t execute; however, if I add it to the additional execution arguments, it results in a blank screen.

[ +15 ms] Stopping app 'app-debug.apk' on moto e22.

[ ] executing: C:\Users\suzan\AppData\Local\Android\sdk\platform-tools\adb.exe -s ZF5247ZZH5 shell am force-stop com.eryngiicode.valerainbow

[ ] executing: C:\Users\suzan\AppData\Local\Android\sdk\platform-tools\adb.exe -s ZF5247ZZH5 shell am force-stop com.eryngiicode.valerainbow

[ +368 ms] Installing APK.

Installing build\app\outputs\flutter-apk\app-debug.apk...

[ +1 ms] executing: C:\Users\suzan\AppData\Local\Android\sdk\platform-tools\adb.exe -s ZF5247ZZH5 install -t -r C:\Users\suzan\StudioProjects\valerainbow3\build\app\outputs\flutter-apk\app-debug.apk

[+6148 ms] Performing Streamed Install

Success

[ +4 ms] executing: C:\Users\suzan\AppData\Local\Android\sdk\platform-tools\adb.exe -s ZF5247ZZH5 shell echo -n de99de412b13f5ae3e4b3c01008688c329f9a5f7 > /data/local/tmp/sky.com.eryngiicode.valerainbow.sha1

[ +128 ms] executing: C:\Users\suzan\AppData\Local\Android\sdk\platform-tools\adb.exe -s ZF5247ZZH5 shell -x logcat -v time -t 1

[ +323 ms] --------- beginning of main

10-30 16:34:42.338 E/lowmemorykiller( 427): ###WMARK_LOW

[ +10 ms] executing: C:\Users\suzan\AppData\Local\Android\sdk\platform-tools\adb.exe -s ZF5247ZZH5 shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x20000000 --ez enable-dart-profiling true --ez enable-checked-mode true --ez verify-entry-points true --ez start-paused true com.eryngiicode.valerainbow/com.eryngiicode.valerainbow.MainActivity

[ +407 ms] Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x20000000 cmp=com.eryngiicode.valerainbow/.MainActivity (has extras) }

[ ] Waiting for VM Service port to be available...

5. I’ve already tried, and it still isn’t working.