Unverified Commit 61bce1d8 authored by Christopher Fujino's avatar Christopher Fujino Committed by GitHub

[flutter_tools] remove non-null check from AndroidValidator (#90090)

parent 2f9df031
...@@ -202,7 +202,6 @@ class AndroidValidator extends DoctorValidator { ...@@ -202,7 +202,6 @@ class AndroidValidator extends DoctorValidator {
if (androidSdkLatestVersion.sdkLevel < kAndroidSdkMinVersion || androidSdkLatestVersion.buildToolsVersion < kAndroidSdkBuildToolsMinVersion) { if (androidSdkLatestVersion.sdkLevel < kAndroidSdkMinVersion || androidSdkLatestVersion.buildToolsVersion < kAndroidSdkBuildToolsMinVersion) {
messages.add(ValidationMessage.error( messages.add(ValidationMessage.error(
_userMessages.androidSdkBuildToolsOutdated( _userMessages.androidSdkBuildToolsOutdated(
_androidSdk!.sdkManagerPath!,
kAndroidSdkMinVersion, kAndroidSdkMinVersion,
kAndroidSdkBuildToolsMinVersion.toString(), kAndroidSdkBuildToolsMinVersion.toString(),
_platform, _platform,
...@@ -458,7 +457,7 @@ class AndroidLicenseValidator extends DoctorValidator { ...@@ -458,7 +457,7 @@ class AndroidLicenseValidator extends DoctorValidator {
return exitCode == 0; return exitCode == 0;
} on ProcessException catch (e) { } on ProcessException catch (e) {
throwToolExit(_userMessages.androidCannotRunSdkManager( throwToolExit(_userMessages.androidCannotRunSdkManager(
_androidSdk.sdkManagerPath!, _androidSdk.sdkManagerPath ?? '',
e.toString(), e.toString(),
_platform, _platform,
)); ));
......
...@@ -117,7 +117,7 @@ class UserMessages { ...@@ -117,7 +117,7 @@ class UserMessages {
'Android sdkmanager tool was found, but failed to run ($sdkManagerPath): "$error".\n' 'Android sdkmanager tool was found, but failed to run ($sdkManagerPath): "$error".\n'
'Try re-installing or updating your Android SDK,\n' 'Try re-installing or updating your Android SDK,\n'
'visit ${_androidSdkInstallUrl(platform)} for detailed instructions.'; 'visit ${_androidSdkInstallUrl(platform)} for detailed instructions.';
String androidSdkBuildToolsOutdated(String managerPath, int sdkMinVersion, String buildToolsMinVersion, Platform platform) => String androidSdkBuildToolsOutdated(int sdkMinVersion, String buildToolsMinVersion, Platform platform) =>
'Flutter requires Android SDK $sdkMinVersion and the Android BuildTools $buildToolsMinVersion\n' 'Flutter requires Android SDK $sdkMinVersion and the Android BuildTools $buildToolsMinVersion\n'
'To update the Android SDK visit ${_androidSdkInstallUrl(platform)} for detailed instructions.'; 'To update the Android SDK visit ${_androidSdkInstallUrl(platform)} for detailed instructions.';
String get androidMissingCmdTools => 'cmdline-tools component is missing\n' String get androidMissingCmdTools => 'cmdline-tools component is missing\n'
......
...@@ -386,7 +386,6 @@ Review licenses that have not been accepted (y/N)? ...@@ -386,7 +386,6 @@ Review licenses that have not been accepted (y/N)?
..latestVersion = sdkVersion; ..latestVersion = sdkVersion;
final String errorMessage = UserMessages().androidSdkBuildToolsOutdated( final String errorMessage = UserMessages().androidSdkBuildToolsOutdated(
sdk.sdkManagerPath,
kAndroidSdkMinVersion, kAndroidSdkMinVersion,
kAndroidSdkBuildToolsMinVersion.toString(), kAndroidSdkBuildToolsMinVersion.toString(),
FakePlatform(), FakePlatform(),
......
...@@ -27,7 +27,7 @@ void main() { ...@@ -27,7 +27,7 @@ void main() {
_checkInstallationURL((Platform platform) => userMessages.androidSdkInstallHelp(platform)); _checkInstallationURL((Platform platform) => userMessages.androidSdkInstallHelp(platform));
_checkInstallationURL((Platform platform) => userMessages.androidMissingSdkManager('/', platform)); _checkInstallationURL((Platform platform) => userMessages.androidMissingSdkManager('/', platform));
_checkInstallationURL((Platform platform) => userMessages.androidCannotRunSdkManager('/', '', platform)); _checkInstallationURL((Platform platform) => userMessages.androidCannotRunSdkManager('/', '', platform));
_checkInstallationURL((Platform platform) => userMessages.androidSdkBuildToolsOutdated('/', 0, '', platform)); _checkInstallationURL((Platform platform) => userMessages.androidSdkBuildToolsOutdated(0, '', platform));
_checkInstallationURL((Platform platform) => userMessages.androidStudioInstallation(platform)); _checkInstallationURL((Platform platform) => userMessages.androidStudioInstallation(platform));
}); });
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment