xxxxxxxxxx
Solved with replacing this line
(~/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.9.2/lib/android.dart#308):
// final String minSdk = line.replaceAll(RegExp(r'[^\d]'), '');
// To this:
final String minSdk = "21"; // line.replaceAll(RegExp(r'[^\d]'), '');
That's so stupid I know. But why not? If it's only for the one time of using it.
xxxxxxxxxx
edit this file -> android/app/build.gradle.
change:
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
To:
minSdkVersion 26
targetSdkVersion 30
xxxxxxxxxx
see this: https://stackoverflow.com/questions/70580684/flutter-launcher-icons-not-working-unhandled-exception-formatexception-invalid
xxxxxxxxxx
I just had the same problem and solved doing this in android/app/build.gradle.
Changed:
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
To:
minSdkVersion 26
targetSdkVersion 30
After that, I could not run on emulator, so I changed back the gradle file
(without running flutter_launcher_icon again). Now I have the app running and
the icons are right.