6
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

flutter_launcher_iconsでFormatException: Invalid number (at character 1)となる場合

Posted at

#はじめに

Flutterでアイコンを設定するときに使える👆のパッケージ。
このパッケージでアイコンを生成するための以下のコマンドを実行すると、

flutter pub run flutter_launcher_icons:main

なぜかエラーが発生してしまいます・・・

FormatException: Invalid number (at character 1)

#環境
既にassets/icon/icon.pngは設置済みとする。

pubspec.yaml
environment:
  sdk: ">=2.16.1 <3.0.0"

dev_dependencies:
  flutter_launcher_icons: "^0.9.2"

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

#minSdkVersionを変更してもダメなんだが・・・
普通に検索すると👇のように、android/app/build.gradleのminSdkVersionを直接の数値で指定する方法が多く出てきます。

が、私の場合はこれらをやっても解決しませんでした・・・:sweat:

#flutter_launcher_iconsをgitから直接引っ張ってきて解決??

「アプリのアイコン設定」の項目で以下のような記載がありました。

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

これで私も解決しました!!!

(一体どう言うことなのかいまいちわかりませんが・・・:sweat_smile:

6
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?