Skip to content
New issue

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

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

Already on GitHub? # to your account

Android Studio : pub finished with exit code 255 #352

Closed
ashishazilen opened this issue Mar 25, 2022 · 9 comments
Closed

Android Studio : pub finished with exit code 255 #352

ashishazilen opened this issue Mar 25, 2022 · 9 comments

Comments

@ashishazilen
Copy link

ℹ️ Info

version: 1.0.0+1

environment:
sdk: ">=2.16.1 <3.0.0"

💬 Description

#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

📜 Pubspec.yaml

dev_dependencies:
flutter_test:
sdk: flutter

flutter_launcher_icons: ^0.9.2
cupertino_icons: ^1.0.2
flutter_lints: ^1.0.0

flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
adaptive_icon_background: "assets/icon/icon.png"

@alexandranb1
Copy link

Hello,

I have the same issue, did you manage to find a solution?

Thank you

@MohammedAlabadla
Copy link

I have the same issue

@williamluke4
Copy link

williamluke4 commented Mar 27, 2022

I did some digging and it seems that this is related to this bit of the code https://github.com/fluttercommunity/flutter_launcher_icons/blob/master/lib/android.dart#L309 basically int.parse(minSdk) is called with an empty string.
I assume this happens when your build.gradle file contains the following instead of a static value for the minVersion.

  defaultConfig {
        applicationId "com.grassecon.org.my_sarafu"
        minSdkVersion flutter.minSdkVersion
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

As a quick hack you can change the following line https://github.com/fluttercommunity/flutter_launcher_icons/blob/master/lib/android.dart#L309

- return int.parse(minSdk);
+ return minSdk.isNotEmpty ? int.parse(minSdk) : 0;

@yinrong
Copy link

yinrong commented Mar 27, 2022

@williamluke4 not working.

in my situation, it works after flutter clean

image

@ranfen
Copy link

ranfen commented Mar 29, 2022

I did some digging and it seems that this is related to this bit of the code https://github.com/fluttercommunity/flutter_launcher_icons/blob/master/lib/android.dart#L309 basically int.parse(minSdk) is called with an empty string. I assume this happens when your build.gradle file contains the following instead of a static value for the minVersion.

  defaultConfig {
        applicationId "com.grassecon.org.my_sarafu"
        minSdkVersion flutter.minSdkVersion
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

As a quick hack you can change the following line https://github.com/fluttercommunity/flutter_launcher_icons/blob/master/lib/android.dart#L309

- return int.parse(minSdk);
+ return minSdk.isNotEmpty ? int.parse(minSdk) : 0;

This solved the problem thanks

@riswanmsm
Copy link

riswanmsm commented Apr 5, 2022

edit the file android/app/build.gradle and chnage the params like below

 minSdkVersion 21
 targetSdkVersion 29

after the change run the below commands in terminal

 flutter pub get
 flutter pub run flutter_launcher_icons:main

after generating the icons successfully, change back the edited above lines like to their original form like below

minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion

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

@AslanMidyat
Copy link

Thanks

@darkrisen3
Copy link

edit the file android/app/build.gradle and chnage the params like below

 minSdkVersion 21
 targetSdkVersion 29

after the change run the below commands in terminal

 flutter pub get
 flutter pub run flutter_launcher_icons:main

after generating the icons successfully, change back the edited above lines like to their original form like below

minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion

this worked for me, but I did not change back the syntax as you showed in the last step, will that be a problem?

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

No branches or pull requests

10 participants