Flutter Launcher Icons getting Index out of range error

181 Views Asked by At

Trying to generate app icons using flutter_launcher_icons package but no matter what image I use it always ends up with and error with no additional information:

Terminal:

dart run flutter_launcher_icons
Building package executable... (2.0s)
Built flutter_launcher_icons:flutter_launcher_icons.
════════════════════════════════════════════
FLUTTER LAUNCHER ICONS (v0.13.1)  
════════════════════════════════════════════

• Creating default icons Android
• Adding a new Android launcher icon

✕ Could not generate launcher icons
RangeError (index): Index out of range: index should be less than 9216: 9252

My configuration

flutter_launcher_icons:
  android: 'launcher_icon'
  ios: true
  image_path: 'assets/images/shovel-brown.png'

I have tried several different pictures: png / jpg, different sizes from 1 KB to 12 KB, no transparent layer, etc...

Tried downgrading the flutter_launcher_icons to lower version with no luck

Upgraded all the other dependecies and tooling aroud flutter and android studio to newest version.

2

There are 2 best solutions below

0
On

add image package should solve the issue. image: ^4.1.3 or latest version.

0
On

flutter_launcher_icons was last updated about 5 months ago and flutter has had a number of updates since then, I guess it's now compatibility issues with the recent updates to flutter. I just had to change the app icon manually for now, you can follow this short tutorial on how to do that