File tree 4 files changed +14
-8
lines changed
4 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ class AndroidValidator extends DoctorValidator {
167
167
} else {
168
168
// Instruct user to set [kAndroidSdkRoot] and not deprecated [kAndroidHome]
169
169
// See https://github.com/flutter/flutter/issues/39301
170
- messages.add (ValidationMessage .error (_userMessages.androidMissingSdkInstructions (kAndroidSdkRoot, _platform)));
170
+ messages.add (ValidationMessage .error (_userMessages.androidMissingSdkInstructions (_platform)));
171
171
}
172
172
return ValidationResult (ValidationType .missing, messages);
173
173
}
@@ -198,7 +198,7 @@ class AndroidValidator extends DoctorValidator {
198
198
_androidSdk.latestVersion.platformName,
199
199
_androidSdk.latestVersion.buildToolsVersionName)));
200
200
} else {
201
- messages.add (ValidationMessage .error (_userMessages.androidMissingSdkInstructions (kAndroidHome, _platform)));
201
+ messages.add (ValidationMessage .error (_userMessages.androidMissingSdkInstructions (_platform)));
202
202
}
203
203
204
204
if (_platform.environment.containsKey (kAndroidHome)) {
Original file line number Diff line number Diff line change @@ -69,13 +69,13 @@ class UserMessages {
69
69
String androidBadSdkDir (String envKey, String homeDir) =>
70
70
'$envKey = $homeDir \n '
71
71
'but Android SDK not found at this location.' ;
72
- String androidMissingSdkInstructions (String envKey, Platform platform) =>
72
+ String androidMissingSdkInstructions (Platform platform) =>
73
73
'Unable to locate Android SDK.\n '
74
74
'Install Android Studio from: https://developer.android.com/studio/index.html\n '
75
75
'On first launch it will assist you in installing the Android SDK components.\n '
76
76
'(or visit ${_androidSdkInstallUrl (platform )} for detailed instructions).\n '
77
- 'If the Android SDK has been installed to a custom location, set $ envKey to that location. \n '
78
- 'You may also want to add it to your PATH environment variable .\n ' ;
77
+ 'If the Android SDK has been installed to a custom location, please use \n '
78
+ '`flutter config --android-sdk` to update to that location .\n ' ;
79
79
String androidSdkLocation (String directory) => 'Android SDK at $directory ' ;
80
80
String androidSdkPlatformToolsVersion (String platform, String tools) =>
81
81
'Platform $platform , build-tools $tools ' ;
Original file line number Diff line number Diff line change @@ -329,9 +329,15 @@ void main() {
329
329
validationResult.messages.last.message,
330
330
errorMessage,
331
331
);
332
+ expect (
333
+ validationResult.messages.any (
334
+ (ValidationMessage message) => message.message.contains ('Unable to locate Android SDK' )
335
+ ),
336
+ false ,
337
+ );
332
338
});
333
339
334
- testWithoutContext ('Mentions `kAndroidSdkRoot if user has no AndroidSdk`' , () async {
340
+ testWithoutContext ('Mentions `flutter config --android-sdk if user has no AndroidSdk`' , () async {
335
341
final ValidationResult validationResult = await AndroidValidator (
336
342
androidSdk: null ,
337
343
androidStudio: null ,
@@ -343,7 +349,7 @@ void main() {
343
349
).validate ();
344
350
expect (
345
351
validationResult.messages.any (
346
- (ValidationMessage message) => message.message.contains (kAndroidSdkRoot )
352
+ (ValidationMessage message) => message.message.contains ('flutter config --android-sdk' )
347
353
),
348
354
true ,
349
355
);
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ void main() {
23
23
24
24
testWithoutContext ('Android installation instructions' , () {
25
25
final UserMessages userMessages = UserMessages ();
26
- _checkInstallationURL ((Platform platform) => userMessages.androidMissingSdkInstructions ('ANDROID_SDK_ROOT' , platform));
26
+ _checkInstallationURL ((Platform platform) => userMessages.androidMissingSdkInstructions (platform));
27
27
_checkInstallationURL ((Platform platform) => userMessages.androidSdkInstallHelp (platform));
28
28
_checkInstallationURL ((Platform platform) => userMessages.androidMissingSdkManager ('/' , platform));
29
29
_checkInstallationURL ((Platform platform) => userMessages.androidCannotRunSdkManager ('/' , '' , platform));
You can’t perform that action at this time.
0 commit comments