[flutter_tools] Add documentation to "cmdline-tools component is missing" doctor validation error (#83356)
This commit is contained in:
parent
b9377f358c
commit
f9cd87e60a
@ -186,7 +186,7 @@ class AndroidValidator extends DoctorValidator {
|
||||
return ValidationResult(ValidationType.missing, messages);
|
||||
}
|
||||
if (!androidSdk.cmdlineToolsAvailable) {
|
||||
messages.add(const ValidationMessage.error('cmdline-tools component is missing'));
|
||||
messages.add(ValidationMessage.error(_userMessages.androidMissingCmdTools));
|
||||
return ValidationResult(ValidationType.missing, messages);
|
||||
}
|
||||
|
||||
|
@ -120,6 +120,9 @@ class UserMessages {
|
||||
String androidSdkBuildToolsOutdated(String managerPath, int sdkMinVersion, String buildToolsMinVersion, Platform platform) =>
|
||||
'Flutter requires Android SDK $sdkMinVersion and the Android BuildTools $buildToolsMinVersion\n'
|
||||
'To update the Android SDK visit ${_androidSdkInstallUrl(platform)} for detailed instructions.';
|
||||
String get androidMissingCmdTools => 'cmdline-tools component is missing\n'
|
||||
'Run `path/to/sdkmanager --install "cmdline-tools;latest"`\n'
|
||||
'See https://developer.android.com/studio/command-line for more details.';
|
||||
|
||||
// Messages used in AndroidStudioValidator
|
||||
String androidStudioVersion(String version) => 'version $version';
|
||||
|
@ -395,11 +395,13 @@ Review licenses that have not been accepted (y/N)?
|
||||
userMessages: UserMessages(),
|
||||
);
|
||||
|
||||
final String errorMessage = UserMessages().androidMissingCmdTools;
|
||||
|
||||
final ValidationResult validationResult = await androidValidator.validate();
|
||||
expect(validationResult.type, ValidationType.missing);
|
||||
expect(
|
||||
validationResult.messages.last.message,
|
||||
'cmdline-tools component is missing',
|
||||
errorMessage,
|
||||
);
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user