Skip to content

Include more information about adb failure in flutter daemon exit messages #125971

@DanTup

Description

@DanTup

There have been some reports of the flutter daemon command (which IDEs use to maintain a list of available devices) crashing after some period of time (this was the cause of both Dart-Code/Dart-Code#4510, Dart-Code/Dart-Code#4475).

In a log provided by @guidezpl, there is this:

[9:46:07 PM] [FlutterDaemon] [Info] <== [{"event":"daemon.logMessage","params":{"level":"error","message":"Unable to run \"adb\", check your Android SDK installation and ANDROID_SDK_ROOT environment variable: /Users/plg/Library/Android/sdk/platform-tools/adb"}}]
[9:46:07 PM] [FlutterDaemon] [Info] Process /Users/plg/Developer/flutter-dev/bin/flutter terminated! 1, null

The daemon sent this error message and then terminated with an exit code of 1. The origin of this message is here:

} on ProcessException catch (exception) {
throwToolExit(
'Unable to run "adb", check your Android SDK installation and '
'$kAndroidSdkRoot environment variable: ${exception.executable}',
);
}

It's not clear why this error is occurring, but it would be useful to expand the error message to include additional information that might help. For example, the exception message, exitCode and the stackTrace might help a) understand what this failure actually was, and b) what the code was actually running adb for.

@christopherfujino

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: proposalA detailed proposal for a change to Flutterr: fixedIssue is closed as already fixed in a newer versionteam-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