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

pub finished with exit code 255 #356

Closed
OnClickListener2048 opened this issue Apr 6, 2022 · 5 comments · Fixed by #322
Closed

pub finished with exit code 255 #356

OnClickListener2048 opened this issue Apr 6, 2022 · 5 comments · Fixed by #322

Comments

@OnClickListener2048
Copy link

Microsoft Windows [版本 10.0.22581.200]
(c) Microsoft Corporation。保留所有权利。

E:\studioProjects\flutterdemo>flutter pub run flutter_launcher_icons:main
════════════════════════════════════════════
FLUTTER LAUNCHER ICONS (v0.9.1)
════════════════════════════════════════════

✓ Successfully generated launcher icons
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:///D:/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

E:\studioProjects\flutterdemo>flutter pub run flutter_launcher_icons:main
════════════════════════════════════════════
FLUTTER LAUNCHER ICONS (v0.9.1)
════════════════════════════════════════════

✓ Successfully generated launcher icons
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:///D:/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

E:\studioProjects\flutterdemo>flutter pub run flutter_launcher_icons:main
════════════════════════════════════════════
FLUTTER LAUNCHER ICONS (v0.9.1)
════════════════════════════════════════════

✓ Successfully generated launcher icons
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:///D:/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

E:\studioProjects\flutterdemo>flutter pub run flutter_launcher_icons:main
════════════════════════════════════════════
FLUTTER LAUNCHER ICONS (v0.9.1)
════════════════════════════════════════════

✓ Successfully generated launcher icons
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:///D:/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

@priyankabambharoliya-official

I am getting the same issue

@priyankabambharoliya-official

I found quick fix, here it is #351 (comment)

@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.

@AzilYahia
Copy link

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.

thank you, it works!

@cotwitch
Copy link

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.

5 participants