Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormatException: Invalid number (at character 1) #345

Closed
walidaguib7 opened this issue Mar 3, 2022 · 8 comments
Closed

FormatException: Invalid number (at character 1) #345

walidaguib7 opened this issue Mar 3, 2022 · 8 comments

Comments

@walidaguib7
Copy link

No description provided.

@eilgug
Copy link

eilgug commented Mar 4, 2022

Thers's another issue open about this and probably this is going to be fixed. At least you can solve that issue following this solution: https://stackoverflow.com/questions/70580684/flutter-launcher-icons-not-working-unhandled-exception-formatexception-invalid

@mbnoimi
Copy link

mbnoimi commented Mar 10, 2022

Thank you @eilgug but this is not a practical solution.

@felipeparente
Copy link

I get a same error.

@mgesmundo
Copy link

+1

@LahaLuhem
Copy link

LahaLuhem commented Apr 7, 2022

I have an easy fix:

  1. Change Line 308 in Dart Packages/flutter_launcher_icons/android.dart:
    • previous: final String minSdk = line.replaceAll(RegExp(r'[^\d]'), '');
    • change to: final String minSdk = "21";
  2. Recompile the packages by running flutter clean, followed by flutter pub get again
  3. Run generating procedure again by flutter pub run flutter_launcher_icons:main

It just skips the parsing of the manifest file directly to get the minSDK version line.

@cotwitch
Copy link

@alanrubin
Copy link

The last package didn't work as well (Flutter 2.10.5).

The problem is that build.gradle has now a variable instead of a number for minSdkVersion and this package cannot deal with that.

 defaultConfig {
        applicationId "xxx.yyy.zzz"
        minSdkVersion flutter.minSdkVersion // Error here: Expected a number instead of a variable
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

To make it work locally you can simply replace the flutter.minSdkVersion for a number (21 for example). That will make it work. Not ideal but it works. I don't think you will generate the icons often so it should be fine.

@RatakondalaArun
Copy link
Collaborator

fixed in #322

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants