Skip to content

[tool_crash] Opening devtools without Chrome installed crashes flutter tool  #154940

Closed

Description

@saltedpotatos

PR #154941

Crashes at

unawaited(Chrome.start(<String>[devToolsUrl]));

trying to launch Chrome via package:browser_launcher

Exception: No such file or directory Command: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome, OS error code: 2

Command

flutter run -d macos

Steps to Reproduce

  1. flutter run -d macos
  2. hit v to open dev tools
Launching Flutter DevTools for macOS at
http://127.0.0.1:9101?uri=http%3A%2F%2F127.0.0.1%3A53732%2FN2SDRmqaagc%3D%
2F

Oops; flutter has exited unexpectedly: "ProcessException: No such file or
directory
  Command: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
  http://127.0.0.1:9101?uri=http%3A%2F%2F127.0.0.1%3A53732%2FN2SDRmqaagc%3
  D%2F".

Logs

ProcessException: No such file or directory Command: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome, OS error code: 2

#0      _ProcessImpl._start (dart:io-patch/process_patch.dart:402:33)
#1      Process.start (dart:io-patch/process_patch.dart:38:20)
#2      Chrome._startProcess (package:browser_launcher/src/chrome.dart:156:26)
#3      Chrome.start (package:browser_launcher/src/chrome.dart:148:18)
#4      FlutterResidentDevtoolsHandler._launchDevToolsForDevices (package:flutter_tools/src/resident_devtools_handler.dart:188:24)
#5      FlutterResidentDevtoolsHandler.launchDevToolsInBrowser (package:flutter_tools/src/resident_devtools_handler.dart:176:7)
#6      TerminalHandler._commonTerminalInputHandler (package:flutter_tools/src/resident_runner.dart:1818:56)
#7      TerminalHandl➜  flungdung

Activity

  1. added
    in triagePresently being triaged by the triage team
    on Sep 11, 2024
  2. huycozy commented on Sep 11, 2024

    @huycozy
    Member

    Reproduced this on Flutter stable 3.24.2 and master 3.26.0-1.0.pre.72. Thank you for the report.

    flutter doctor -v
    [✓] Flutter (Channel stable, 3.24.2, on macOS 14.6 23G80 darwin-x64, locale en-VN)
        • Flutter version 3.24.2 on channel stable at /Users/huynq/Documents/GitHub/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 4cf269e36d (7 days ago), 2024-09-03 14:30:00 -0700
        • Engine revision a6bd3f1de1
        • Dart version 3.5.2
        • DevTools version 2.37.2
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-35, build-tools 35.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 15.4)
        • Xcode at /Applications/Xcode15.4.app/Contents/Developer
        • Build 15F31d
        • CocoaPods version 1.15.2
    
    [✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
        ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
    
    [✓] Android Studio (version 2024.1)
        • Android Studio at /Applications/Android Studio Koala.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    
    [✓] Android Studio (version 2023.3)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • android-studio-dir = /Applications/Android Studio.app/
        • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    
    [✓] IntelliJ IDEA Ultimate Edition (version 2024.2.0.2)
        • IntelliJ at /Applications/IntelliJ IDEA.app
        • Flutter plugin version 81.1.3
        • Dart plugin version 242.20629
    
    [✓] VS Code (version 1.93.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.96.0
    
    [✓] Connected device (3 available)
        • Pixel 7 (mobile) • 2B171FDH20084L                           • android-arm64 • Android 14 (API 34)
        • iPhone (mobile)  • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios           • iOS 15.8 19H370
        • macOS (desktop)  • macos                                    • darwin-x64    • macOS 14.6 23G80 darwin-x64
    
    [✓] Network resources
        • All expected network resources are available.
    
    ! Doctor found issues in 1 category.
    [!] Flutter (Channel master, 3.26.0-1.0.pre.72, on macOS 14.6 23G80 darwin-x64, locale en-VN)
        • Flutter version 3.26.0-1.0.pre.72 on channel master at /Users/huynq/Documents/GitHub/flutter_master
        ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at
          /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at
          /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 8a2c3a65fe (6 hours ago), 2024-09-10 22:16:25 -0400
        • Engine revision a26075f9b1
        • Dart version 3.6.0 (build 3.6.0-237.0.dev)
        • DevTools version 2.39.0
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-35, build-tools 35.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 15.4)
        • Xcode at /Applications/Xcode15.4.app/Contents/Developer
        • Build 15F31d
        • CocoaPods version 1.15.2
    
    [✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
        ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
    
    [✓] Android Studio (version 2024.1)
        • Android Studio at /Applications/Android Studio Koala.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    
    [✓] Android Studio (version 2023.3)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • android-studio-dir = /Applications/Android Studio.app/
        • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    
    [✓] IntelliJ IDEA Ultimate Edition (version 2024.2.0.2)
        • IntelliJ at /Applications/IntelliJ IDEA.app
        • Flutter plugin version 81.1.3
        • Dart plugin version 242.20629
    
    [✓] VS Code (version 1.93.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.96.0
    
    [✓] Connected device (3 available)
        • Pixel 7 (mobile) • 2B171FDH20084L                           • android-arm64 • Android 14 (API 34)
        • iPhone (mobile)  • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios           • iOS 15.8 19H370
        • macOS (desktop)  • macos                                    • darwin-x64    • macOS 14.6 23G80 darwin-x64
    
    [✓] Network resources
        • All expected network resources are available.
    
    ! Doctor found issues in 2 categories.
  3. added
    c: crashStack traces logged to the console
    toolAffects the "flutter" command-line tool. See also t: labels.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    team-toolOwned by Flutter Tool team
    and removed
    in triagePresently being triaged by the triage team
    on Sep 11, 2024
  4. added
    P2Important issues not at the top of the work list
    triaged-toolTriaged by Flutter Tool team
    on Oct 8, 2024
  5. saltedpotatos commented on Jan 21, 2025

    @saltedpotatos
    ContributorAuthor

    Closing this issue since the PR is now merged. Thanks everyone!

  6. github-actions commented on Feb 4, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  7. locked as resolved and limited conversation to collaborators on Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: crashStack traces logged to the consolefound in release: 3.24Found to occur in 3.24found in release: 3.26Found to occur in 3.26has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions