Flutter Chrome Linux: Cannot find Chrome executable
Table of Content
If you are using Flutter on Linux, and you installed Google Chrome using Flapak, you may face the problem when installing and running Flutter:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.7, on Manjaro Linux 5.15.102-1-MANJARO, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✗] 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
[✓] Android Studio (version 2021.3)
[✓] Connected device (1 available)
[✓] HTTP Host Availability
Flutter required Google Chrome path to be set in: CHROME_EXECUTABLE. Here is how you can do that, as you find your Google Chrome binary, then set your it:
export CHROME_EXECUTABLE=/var/lib/flatpak/exports/bin/com.google.Chrome