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

[BUG] Unhandled exception: FormatException: Invalid number (at character 1) #333

Closed
amalikmuhd opened this issue Feb 5, 2022 · 13 comments · Fixed by #322
Closed

[BUG] Unhandled exception: FormatException: Invalid number (at character 1) #333

amalikmuhd opened this issue Feb 5, 2022 · 13 comments · Fixed by #322

Comments

@amalikmuhd
Copy link

amalikmuhd commented Feb 5, 2022

ℹ️ Info

Version: e.g. v0.9.2

💬 Description

I updated flutter to 2.10.0, I ran the command and it showed successfully " Successfully generated launcher icons" but below the successful sentence I got this below message

Unhandled exception:
FormatException: Invalid number (at character 1)

^

#0 int._handleFormatError (dart:core-patch/integers_patch.dart:129:7)
#1 int.parse (dart:core-patch/integers_patch.dart:55:14)
#2 minSdk (package:flutter_launcher_icons/android.dart:309:18)
#3 createIconsFromConfig (package:flutter_launcher_icons/main.dart:94:47)
#4 createIconsFromArguments (package:flutter_launcher_icons/main.dart:60:7)
#5 main (file:///Users/aoomle/tools/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.9.2/bin/main.dart:6:26)
#6 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:295:32)
#7 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
pub finished with exit code 255

@KAnggara75
Copy link

Screen Shot 2022-02-05 at 14 30 05

i have same bug like yours, with v0.9.1

@wocodes
Copy link

wocodes commented Feb 5, 2022

Experienced same here

@KAnggara75
Copy link

ℹ️ Info

Version: e.g. v0.9.2

💬 Description

I updated flutter to 2.10.0, I ran the command and it showed successfully " Successfully generated launcher icons" but below the successful sentence I got this below message

Unhandled exception: FormatException: Invalid number (at character 1)

^

#0 int._handleFormatError (dart:core-patch/integers_patch.dart:129:7) #1 int.parse (dart:core-patch/integers_patch.dart:55:14) #2 minSdk (package:flutter_launcher_icons/android.dart:309:18) #3 createIconsFromConfig (package:flutter_launcher_icons/main.dart:94:47) #4 createIconsFromArguments (package:flutter_launcher_icons/main.dart:60:7) #5 main (file:///Users/aoomle/tools/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.9.2/bin/main.dart:6:26) #6 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:295:32) #7 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12) pub finished with exit code 255

change file android/app/build.gradle
from this
Screen Shot 2022-02-05 at 15 13 29
to this
Screen Shot 2022-02-05 at 15 14 08

@kabagouda
Copy link

I just got the same error and fixed it by manually setting the minSdkVersion in android/app/build.gradle

    defaultConfig {
        applicationId "com.example.foo"
        minSdkVersion 16 // <<== set this
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

New Flutter projects now have the minSdkVersion set to flutter.minSdkVersion which (currently) resolves to 16 but it appears the package does not pick up that value.

EDIT: Note, minSDKVersion 16 is the bare minimum. Some apps may require a higher minimum for like 19 or even 21 depending on what plugins you have installed (e.g. WebView, Google Maps and several FlutterFire plugins etc.)

Originally posted by @cklanac in #324 (comment)

@harlekintiger
Copy link

Also important: You can't have the string 'minSdkVersion' anywhere before the actual declaration of the min SDK Version! If you did //minSdkVersion flutter.minSdkVersion above the version it will crash. Remove it or move it down below the actual declaration.
Maybe the plugin should check if a line is commented out and ignore those

@MikiVanousek
Copy link

I have the same issue. I think solving it by removing flutter.minSdkVersion goes against having things specified in pubspce.yaml, which is the reason I wanted to use this package in the first place.

@Clashkid155
Copy link

Clashkid155 commented Feb 12, 2022

It showing ✓ Successfully generated launcher icons gives the impression that it actually succeed. I think that should be fixed too if it doesn't require to much work.

@codesxt
Copy link

codesxt commented Feb 23, 2022

The solution was not working for me until I read @harlekintiger 's comment. Removed "minSdkVersion" from the comments and it worked perfectly.

@eilgug
Copy link

eilgug commented Mar 4, 2022

@MikiVanousek
Copy link

MikiVanousek commented Mar 30, 2022

It is actually the same for other people's production flutter apps on my device Screenshot_20220330-150510_Yoga.png

@abraralidev
Copy link

I also facing this error. Can anyone tell me the solution?

@MikiVanousek
Copy link

It is not solved.

@Francmape
Copy link

Changed the gradle but error still exists.

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

Successfully merging a pull request may close this issue.