facebook twitter hatena line email

「Flutter/アプリアイコン変更」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(アプリのアイコンの変更適用)
 
(同じ利用者による、間の8版が非表示)
行1: 行1:
==アプリのアイコンを変更==
+
==公式==
 +
https://pub.dev/packages/flutter_launcher_icons#-installing-tab-
  
 +
==アプリのアイコンを変更==
 
pubspec.yml
 
pubspec.yml
 
<pre>
 
<pre>
行6: 行8:
 
   flutter_test:
 
   flutter_test:
 
     sdk: flutter
 
     sdk: flutter
   flutter_launcher_icons: any
+
   flutter_launcher_icons: ^0.7.4
 
</pre>
 
</pre>
  
行12: 行14:
  
 
==アイコン画像を設定==
 
==アイコン画像を設定==
 +
flutter_icons:をpubspec.ymlへインデント無しで記述する
 +
 
pubspec.yml
 
pubspec.yml
flutter_icons:
+
<pre>
 +
dev_dependencies:
 +
 
 +
flutter_icons:
 
   android: true  
 
   android: true  
 
   ios: true
 
   ios: true
 
   image_path: "assets/icon/icon_512x512.png"
 
   image_path: "assets/icon/icon_512x512.png"
 +
</pre>
 +
 +
==アプリのアイコンの変更適用実行==
 +
$ flutter pub run flutter_launcher_icons:main
 +
 +
===InvalidConfigExceptionエラーが出るとき===
 +
エラー詳細
 +
<pre>
 +
✗ ERROR: InvalidConfigException
 +
Cannot not find minSdk from android/app/build.gradle
 +
</pre>
 +
 +
対応方法
 +
 +
android/app/build.gradle
 +
<pre>
 +
-flutter.minSdkVersion
 +
+flutter.minSdkVersion=21
 +
</pre>
  
==アプリのアイコンを変更適応==
+
==ipaのアップロード時の"ERROR ITMS-90717:Invalid App Store Icon. The App Store Icon in the asset catalog in 'Runner.app' can't be transparent nor contain an alpha channel."エラー==
flutter pub pub run flutter_launcher_icons:main
+
画像の透明(アルファ)設定が入ってるので、画像エディッタからアルファの設定を削除
  
 
==参考==
 
==参考==
 
https://qiita.com/k-nasa/items/33426af4d396b581c101
 
https://qiita.com/k-nasa/items/33426af4d396b581c101

2023年8月28日 (月) 10:09時点における最新版

公式

https://pub.dev/packages/flutter_launcher_icons#-installing-tab-

アプリのアイコンを変更

pubspec.yml

dev_dependencies: 
  flutter_test:
    sdk: flutter
  flutter_launcher_icons: ^0.7.4
flutter packages get

アイコン画像を設定

flutter_icons:をpubspec.ymlへインデント無しで記述する

pubspec.yml

dev_dependencies:

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

アプリのアイコンの変更適用実行

$ flutter pub run flutter_launcher_icons:main

InvalidConfigExceptionエラーが出るとき

エラー詳細

✗ ERROR: InvalidConfigException
Cannot not find minSdk from android/app/build.gradle

対応方法

android/app/build.gradle

-flutter.minSdkVersion
+flutter.minSdkVersion=21

ipaのアップロード時の"ERROR ITMS-90717:Invalid App Store Icon. The App Store Icon in the asset catalog in 'Runner.app' can't be transparent nor contain an alpha channel."エラー

画像の透明(アルファ)設定が入ってるので、画像エディッタからアルファの設定を削除

参考

https://qiita.com/k-nasa/items/33426af4d396b581c101