[flutter_tools] handle null value from sdk version (#52351)
When the AndroidDevice checks for the current API version, it isn't handling a null response. While we can refuse to run on API levels that are unsupported, we should probably assume that a null response = lowest possible API level and allow these to run.
This commit is contained in:
@@ -319,9 +319,11 @@ class AndroidDevice extends Device {
|
||||
throwOnError: true,
|
||||
);
|
||||
|
||||
// This has been reported to return null on some devices. In this case,
|
||||
// assume the lowest supported API to still allow Flutter to run.
|
||||
// Sample output: '22'
|
||||
final String sdkVersion = await _getProperty('ro.build.version.sdk');
|
||||
|
||||
final String sdkVersion = await _getProperty('ro.build.version.sdk')
|
||||
?? minApiLevel.toString();
|
||||
|
||||
final int sdkVersionParsed = int.tryParse(sdkVersion);
|
||||
if (sdkVersionParsed == null) {
|
||||
|
||||
Reference in New Issue
Block a user