be more lenient when looking for matching android sdk components (#3830)

* be more lenient when looking for matching android sdk components

* use a null aware operator
This commit is contained in:
Devon Carew 2016-05-11 15:34:24 -07:00
parent 5b3a4e5554
commit 45db865079

View File

@ -147,10 +147,7 @@ class AndroidSdk {
.toList();
}
// Here we match up platforms with cooresponding build-tools. If we don't
// have a match, we don't return anything for that platform version. So if
// the user only has 'android-22' and 'build-tools/19.0.0', we don't find
// an Android sdk.
// Match up platforms with the best cooresponding build-tools.
_sdkVersions = platforms.map((String platformName) {
int platformVersion;
@ -167,6 +164,8 @@ class AndroidSdk {
return version.major == platformVersion;
}).toList());
buildToolsVersion ??= Version.primary(buildTools);
if (buildToolsVersion == null)
return null;