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] not working in dart 2.8 #316

Closed
lcyper opened this issue Dec 24, 2021 · 13 comments · Fixed by #322
Closed

[BUG] not working in dart 2.8 #316

lcyper opened this issue Dec 24, 2021 · 13 comments · Fixed by #322

Comments

@lcyper
Copy link

lcyper commented Dec 24, 2021

ℹ️ Info

flutter_launcher_icons: ^0.9.2

💬 Description

Problem whit "android\app\build.gradle" because on dart 2.8 uses new configuration
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion

Describe the bug
When i try to run the command error happend: pub finished with exit code 255

To Reproduce
Steps to reproduce the behavior:

  1. Create new proyect whit flutter 2.8
  2. add the package, configure and run: flutter pub run flutter_launcher_icons:main
  3. 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:///C:/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

Expected behavior
Set the icons of the app

Screenshots
image

Device (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]

Flutter doctor
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Versión 10.0.19042.1415], locale es-AR)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.63.2)
[√] Connected device (3 available)

• No issues found!

📜 Pubspec.yaml

We ask that you include your pubspec.yaml file as a common problem we have seen has been the pubspec.yaml file being incorrect

name: qrowder_app_web_view
description: A new Flutter project.

The following line prevents the package from being accidentally published to

pub.dev using flutter pub publish. This is preferred for private packages.

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

The following defines the version and build number for your application.

A version number is three numbers separated by dots, like 1.2.43

followed by an optional build number separated by a +.

Both the version and the builder number may be overridden in flutter

build by specifying --build-name and --build-number, respectively.

In Android, build-name is used as versionName while build-number used as versionCode.

Read more about Android versioning at https://developer.android.com/studio/publish/versioning

In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.

Read more about iOS versioning at

https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html

version: 1.0.0+1

environment:
sdk: ">=2.15.0 <3.0.0"

Dependencies specify other packages that your package needs in order to work.

To automatically upgrade your package dependencies to the latest versions

consider running flutter pub upgrade --major-versions. Alternatively,

dependencies can be manually updated by changing the version numbers below to

the latest version available on pub.dev. To see which dependencies have newer

versions available, run flutter pub outdated.

dependencies:
flutter:
sdk: flutter

The following adds the Cupertino Icons font to your application.

Use with the CupertinoIcons class for iOS style icons.

cupertino_icons: ^1.0.2

dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: ^0.9.2
flutter_app_name: ^0.1.0
flutter_native_splash: ^1.3.2

flutter pub run flutter_native_splash:create --path=./flutter_native_splash.yaml

The "flutter_lints" package below contains a set of recommended lints to

encourage good coding practices. The lint set provided by the package is

activated in the analysis_options.yaml file located at the root of your

package. See that file for information about deactivating specific lint

rules and activating additional ones.

flutter_lints: ^1.0.0

For information on the generic Dart part of this file, see the

following page: https://dart.dev/tools/pub/pubspec

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

# adaptive_icon_background: "#ffffff"

# adaptive_icon_foreground: "assets/icons/icon.png"

remove_alpha_ios: true

image_path_android: "assets/icons/ic_launcher.png"

image_path_ios: "assets/icons/ic_launcher.png"

adaptive_icon_background: "assets/icons/ic_launcher_adaptive_back.png"

flutter pub run flutter_launcher_icons:main

flutter_app_name:

name: "Qrowder - Make it happen!"

flutter pub run flutter_app_name

The following section is specific to Flutter.

flutter:

The following line ensures that the Material Icons font is

included with your application, so that you can use the icons in

the material Icons class.

uses-material-design: true

To add assets to your application, add an assets section, like this:

assets:

- images/a_dot_burr.jpeg

- images/a_dot_ham.jpeg

An image asset can refer to one or more resolution-specific "variants", see

https://flutter.dev/assets-and-images/#resolution-aware.

For details regarding adding assets from package dependencies, see

https://flutter.dev/assets-and-images/#from-packages

To add custom fonts to your application, add a fonts section here,

in this "flutter" section. Each entry in this list should have a

"family" key with the font family name, and a "fonts" key with a

list giving the asset and other descriptors for the font. For

example:

fonts:

- family: Schyler

fonts:

- asset: fonts/Schyler-Regular.ttf

- asset: fonts/Schyler-Italic.ttf

style: italic

- family: Trajan Pro

fonts:

- asset: fonts/TrajanPro.ttf

- asset: fonts/TrajanPro_Bold.ttf

weight: 700

For details regarding fonts from package dependencies,

see https://flutter.dev/custom-fonts/#from-packages

@mfurkanyuceal
Copy link

I am also having the same issue. Flutter Version: 2.8.1

@Davenchy
Copy link

same error and i am using flutter 2.8.1

the workaround is to replace minSdkVersion flutter.minSdkVersion with minSdkVersion 19 in the file android/app/build.gradle

@Alijaaan
Copy link

same error and couldn't fix by minSdkVersion

@renitto
Copy link

renitto commented Dec 27, 2021

tried with minSdkVersion 21 still getting the same error.

@Davenchy
Copy link

tried with minSdkVersion 21 still getting the same error.

It is working with me

image

@Makzzzimus
Copy link

same

Davenchy added a commit to Davenchy/flutter_launcher_icons that referenced this issue Dec 30, 2021
[BUG]  not working in dart 2.8 fluttercommunity#316
[BUG] Flutter 2.8.0 incompatibility fluttercommunity#308
@diegosiao
Copy link

@Davenchy Is there a way to apply this fix directly? A way to declare a dependency directly from github like I used to do in my old Cordova projects to take advantage of fixes like this.

@Davenchy
Copy link

@diegosiao in your pubspec.yaml add under dependencies the next lines

flutter_launcher_icons:
  git:
    url: https://github.com/Davenchy/flutter_launcher_icons.git
    ref: fixMinSdkParseFlutter2.8

here you will find more info

@GitGud31
Copy link

GitGud31 commented Jan 4, 2022

Bug is still occuring:

  • Flutter 2.8.1
  • minVersionSdk 21
  • flutter_launcher_icons: "^0.9.2"

it still prints:

2022-01-04_12h48_18

@Davenchy
Copy link

Davenchy commented Jan 4, 2022

@GitGud31 add the package to your pubspec.yaml like this

flutter_launcher_icons:
  git:
    url: https://github.com/Davenchy/flutter_launcher_icons.git
    ref: fixMinSdkParseFlutter2.8

also this will work

flutter_launcher_icons:
  git:
    url: https://github.com/RatakondalaArun/flutter_launcher_icons.git
    ref: fix/flutter-v2.8.0-support-321

but you will need to add the minSdkVersion in the android/local.properties like this

flutter.minSdkVersion=21

@GitGud31
Copy link

GitGud31 commented Jan 5, 2022

@Davenchy Still didn't work is it flutter.minSdkVersion=21 or flutter.minSdkVersion 21 ?

@Davenchy
Copy link

Davenchy commented Jan 5, 2022

@GitGud31 It is working for me!!

image

image

@GitGud31
Copy link

GitGud31 commented Jan 7, 2022

It worked, thanks !

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.

8 participants