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

RangeError #615

Open
plentypvp opened this issue Nov 29, 2024 · 3 comments
Open

RangeError #615

plentypvp opened this issue Nov 29, 2024 · 3 comments
Labels

Comments

@plentypvp
Copy link

ℹ️ Info

Version 0.14.1

💬 Description

PS D:\FlutterProj\talalaeva> flutter pub run flutter_launcher_icons
Deprecated. Use dart run instead.
════════════════════════════════════════════
FLUTTER LAUNCHER ICONS (v0.14.1)
════════════════════════════════════════════

• Creating default icons Android
• Adding a new Android launcher icon
• Creating mipmap xml file Android

✕ Could not generate launcher icons
RangeError (length): Invalid value: Not in inclusive range 0..863: 1020

📜 Pubspec.yaml

flutter_launcher_icons:
android: "launcher_icon"
ios: true
image_path: "assets/mainicon.png"
image_path_ios: "assets/mainicon.png"
remove_alpha_ios: true

@plentypvp plentypvp added the bug label Nov 29, 2024
@plentypvp
Copy link
Author

RangeError (length): Invalid value: Not in inclusive range 0..863: 1020
#0 Uint8List.[] (dart:typed_data-patch/typed_data_patch.dart)
#1 PaletteUint8.get (package:image/src/image/palette_uint8.dart:66:35)
#2 PixelUint8.get (package:image/src/image/pixel_uint8.dart:125:18)
#3 PixelUint8.[] (package:image/src/image/pixel_uint8.dart:131:30)
#4 _convertColor (package:image/src/util/color_util.dart:44:36)
#5 convertColor (package:image/src/util/color_util.dart:91:14)
#6 Image.convert (package:image/src/image/image.dart:905:11)
#7 createIcons (package:flutter_launcher_icons/ios.dart:125:19)
#8 createIconsFromConfig (package:flutter_launcher_icons/main.dart:158:24)
#9 createIconsFromArguments (package:flutter_launcher_icons/main.dart:90:13)
#10 main (file:///D:/FlutterProj/talalaeva/mypkg/bin/flutter_launcher_icons.dart:7:26)
#11 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:295:33)
#12 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

@plentypvp
Copy link
Author

My icon was 1081x1081 PNG image with Indexed color. The problem resolved after converting that to RGB using GIMP.

@mrohlof-protofy
Copy link

We added the image during the build process and did not have the option to change it by hand. Here is my python solution:

$ pip install pillow

from PIL import Image

indexed_image = Image.open(img)
rgb_image = indexed_image.convert('RGB')
rgb_image.save(img)

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

No branches or pull requests

2 participants