I'm trying to build and run the Flutter Hello World example app (sample is included in flutter snap package install) on a raspberry pi with Ubuntu 22.04.2 LTS 5.15.0-1034-raspi. But I'm getting a white screen as shown in the screenshot below.
Running the app as shown below: There's a Gdk-CRITICAL Error which I think is causing the issue. How do I fix this?
Also tried (Gdk-CRITICAL exceptions on a Flutter Desktop app, linux) disabling wayland and restarting gnome as shown in the accepted answer. But it didnt work for me.
drongopi1@drongopi1:~/snap/flutter/common/flutter/examples/hello_world$ flutter run -d linux
Launching lib/main.dart on Linux in debug mode...
Building Linux application...
(hello_world:5130): Gdk-CRITICAL **: 16:05:51.404: gdk_window_get_state: assertion 'GDK_IS_WINDOW (window)' failed
Syncing files to device Linux... 388ms
Flutter run key commands.
r Hot reload.
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
A Dart VM Service on Linux is available at: http://127.0.0.1:40529/ilbmD5GIboo=/
The Flutter DevTools debugger and profiler on Linux is available at:
http://127.0.0.1:9100?uri=http://127.0.0.1:40529/ilbmD5GIboo=/
Flutter doctor output
drongopi1@drongopi1:~$ flutter doctor -v
[✓] Flutter (Channel master, 3.13.0-17.0.pre.80, on Ubuntu 22.04.2 LTS
5.15.0-1034-raspi, locale en_IN)
• Flutter version 3.13.0-17.0.pre.80 on channel master at
/home/drongopi1/snap/flutter/common/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c11ac7be9a (57 minutes ago), 2023-08-07 05:43:32 -0400
• Engine revision b10891e0d8
• Dart version 3.2.0 (build 3.2.0-41.0.dev)
• DevTools version 2.26.1
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from:
https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK
components.
(or visit https://flutter.dev/docs/get-started/install/linux#android-setup
for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✗] Chrome - develop for the web (Cannot find Chrome executable at
google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
• clang version 10.0.0-4ubuntu1
• cmake version 3.16.3
• ninja version 1.10.0
• pkg-config version 0.29.1
[!] Android Studio (not installed)
• Android Studio not found; download from
https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/linux#android-setup
for detailed instructions).
[✓] Connected device (1 available)
• Linux (desktop) • linux • linux-arm64 • Ubuntu 22.04.2 LTS
5.15.0-1034-raspi
[✓] Network resources
• All expected network resources are available.
! Doctor found issues in 3 categories.