Skip to content

Commit

Permalink
Merge pull request fluttercommunity#365 from BenVercammen/android-mip…
Browse files Browse the repository at this point in the history
…map-bg

fix: ignore commented minSdkVersion
  • Loading branch information
RatakondalaArun authored Jun 23, 2022
2 parents e420c33 + 11adaa9 commit 4d379de
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/android.dart
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ int getMinSdkFromFile(File file) {
final List<String> lines = file.readAsLinesSync();
for (String line in lines) {
if (line.contains('minSdkVersion')) {
if (line.contains('//') && line.indexOf('//') < line.indexOf('minSdkVersion')) {
// This line is commented
continue;
}
// remove anything from the line that is not a digit
final String minSdk = line.replaceAll(RegExp(r'[^\d]'), '');
// when minSdkVersion value not found
Expand Down

0 comments on commit 4d379de

Please sign in to comment.