Show help info instead of crashing if Android SDK is not found (#17610)

Fixes #16832
This commit is contained in:
liyuqian
2018-05-15 14:42:12 -07:00
committed by GitHub
parent c36ec76002
commit ae8586cfa1
2 changed files with 23 additions and 0 deletions

View File

@@ -209,6 +209,9 @@ void updateLocalProperties({String projectPath, BuildInfo buildInfo}) {
settings = new SettingsFile.parseFromFile(localProperties);
} else {
settings = new SettingsFile();
if (androidSdk == null) {
throwToolExit('Unable to locate Android SDK. Please run `flutter doctor` for more details.');
}
settings.values['sdk.dir'] = escapePath(androidSdk.directory);
changed = true;
}