Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
3a5e4540
Unverified
Commit
3a5e4540
authored
Sep 17, 2020
by
Daniel Edrisian
Committed by
GitHub
Sep 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated androidMissingSdkInstructions error message (#65964)
parent
1f627769
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
8 deletions
+14
-8
android_workflow.dart
packages/flutter_tools/lib/src/android/android_workflow.dart
+2
-2
user_messages.dart
packages/flutter_tools/lib/src/base/user_messages.dart
+3
-3
android_workflow_test.dart
...ols/test/general.shard/android/android_workflow_test.dart
+8
-2
user_messages_test.dart
...ter_tools/test/general.shard/base/user_messages_test.dart
+1
-1
No files found.
packages/flutter_tools/lib/src/android/android_workflow.dart
View file @
3a5e4540
...
...
@@ -167,7 +167,7 @@ class AndroidValidator extends DoctorValidator {
}
else
{
// Instruct user to set [kAndroidSdkRoot] and not deprecated [kAndroidHome]
// See https://github.com/flutter/flutter/issues/39301
messages
.
add
(
ValidationMessage
.
error
(
_userMessages
.
androidMissingSdkInstructions
(
kAndroidSdkRoot
,
_platform
)));
messages
.
add
(
ValidationMessage
.
error
(
_userMessages
.
androidMissingSdkInstructions
(
_platform
)));
}
return
ValidationResult
(
ValidationType
.
missing
,
messages
);
}
...
...
@@ -198,7 +198,7 @@ class AndroidValidator extends DoctorValidator {
_androidSdk
.
latestVersion
.
platformName
,
_androidSdk
.
latestVersion
.
buildToolsVersionName
)));
}
else
{
messages
.
add
(
ValidationMessage
.
error
(
_userMessages
.
androidMissingSdkInstructions
(
kAndroidHome
,
_platform
)));
messages
.
add
(
ValidationMessage
.
error
(
_userMessages
.
androidMissingSdkInstructions
(
_platform
)));
}
if
(
_platform
.
environment
.
containsKey
(
kAndroidHome
))
{
...
...
packages/flutter_tools/lib/src/base/user_messages.dart
View file @
3a5e4540
...
...
@@ -69,13 +69,13 @@ class UserMessages {
String
androidBadSdkDir
(
String
envKey
,
String
homeDir
)
=>
'
$envKey
=
$homeDir
\n
'
'but Android SDK not found at this location.'
;
String
androidMissingSdkInstructions
(
String
envKey
,
Platform
platform
)
=>
String
androidMissingSdkInstructions
(
Platform
platform
)
=>
'Unable to locate Android SDK.
\n
'
'Install Android Studio from: https://developer.android.com/studio/index.html
\n
'
'On first launch it will assist you in installing the Android SDK components.
\n
'
'(or visit
${_androidSdkInstallUrl(platform)}
for detailed instructions).
\n
'
'If the Android SDK has been installed to a custom location,
set
$envKey
to that location.
\n
'
'
You may also want to add it to your PATH environment variable
.
\n
'
;
'If the Android SDK has been installed to a custom location,
please use
\n
'
'
`flutter config --android-sdk` to update to that location
.
\n
'
;
String
androidSdkLocation
(
String
directory
)
=>
'Android SDK at
$directory
'
;
String
androidSdkPlatformToolsVersion
(
String
platform
,
String
tools
)
=>
'Platform
$platform
, build-tools
$tools
'
;
...
...
packages/flutter_tools/test/general.shard/android/android_workflow_test.dart
View file @
3a5e4540
...
...
@@ -329,9 +329,15 @@ void main() {
validationResult
.
messages
.
last
.
message
,
errorMessage
,
);
expect
(
validationResult
.
messages
.
any
(
(
ValidationMessage
message
)
=>
message
.
message
.
contains
(
'Unable to locate Android SDK'
)
),
false
,
);
});
testWithoutContext
(
'Mentions `
kAndroidSdkRoot
if user has no AndroidSdk`'
,
()
async
{
testWithoutContext
(
'Mentions `
flutter config --android-sdk
if user has no AndroidSdk`'
,
()
async
{
final
ValidationResult
validationResult
=
await
AndroidValidator
(
androidSdk:
null
,
androidStudio:
null
,
...
...
@@ -343,7 +349,7 @@ void main() {
).
validate
();
expect
(
validationResult
.
messages
.
any
(
(
ValidationMessage
message
)
=>
message
.
message
.
contains
(
kAndroidSdkRoot
)
(
ValidationMessage
message
)
=>
message
.
message
.
contains
(
'flutter config --android-sdk'
)
),
true
,
);
...
...
packages/flutter_tools/test/general.shard/base/user_messages_test.dart
View file @
3a5e4540
...
...
@@ -23,7 +23,7 @@ void main() {
testWithoutContext
(
'Android installation instructions'
,
()
{
final
UserMessages
userMessages
=
UserMessages
();
_checkInstallationURL
((
Platform
platform
)
=>
userMessages
.
androidMissingSdkInstructions
(
'ANDROID_SDK_ROOT'
,
platform
));
_checkInstallationURL
((
Platform
platform
)
=>
userMessages
.
androidMissingSdkInstructions
(
platform
));
_checkInstallationURL
((
Platform
platform
)
=>
userMessages
.
androidSdkInstallHelp
(
platform
));
_checkInstallationURL
((
Platform
platform
)
=>
userMessages
.
androidMissingSdkManager
(
'/'
,
platform
));
_checkInstallationURL
((
Platform
platform
)
=>
userMessages
.
androidCannotRunSdkManager
(
'/'
,
''
,
platform
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment