FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
115 stars 19 forks source link

Launcher Icon #1521

Closed Kum0-Iwazaru closed 11 months ago

Kum0-Iwazaru commented 11 months ago

Has your issue been reported?

Current Behavior

I used to download the code from the FlutterFlow app, and test the app directly on a device, but since this morning (FR/Paris timezone), I can't generate launcher icon using the command given by FlutterFlow App ("flutter pub run flutter_launcher_icons:main").

I got the following error when trying :

Deprecated. Use `dart run` instead.
Building package executable... (1.5s)
Built flutter_launcher_icons:main.
This command is deprecated and replaced with "flutter pub run flutter_launcher_icons"
  ════════════════════════════════════════════
     FLUTTER LAUNCHER ICONS (v0.12.0)                               
  ════════════════════════════════════════════

• Creating default icons Android
• Overwriting the default Android launcher icon with a new icon

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

According to the flutter flow community : https://community.flutterflow.io/project-settings/post/can-t-generate-launcher-icons-FDY1EdEgpezC6De The problem could be solved by reducing icon size (this didn't worked for me), or upgrade flutter_launcher_icons, which didn't work too...

This block the deployment because it cause error.

N.B: The application can start, but without icon !

Expected Behavior

Normally the icon should be generated without any error.

Steps to Reproduce

  1. Download code from FlutterFlow App
  2. Open the project on Android Studio
  3. Type flutter pub run flutter_launcher_icons:main on a terminal

Reproducible from Blank

Bug Report Code (Required)

ITEehfLl5ZBOtbxe18/9bsdF/AMwGkQ5a7sviu5+FBQaI+PyPewUYMj7VBNtcuqHfQk7GlGjoFsDwd7Ghez1EMJeOROec4BlzcxfUxDveD+tMpSMDpa3PnMmGfFMCna65MCrrRJRAPhhW1oCwF2MA+u+b3qCf9qOYwx5e6fDbOY=

Context

This block development and deployment of any of my apps.

Visual documentation

Screenshot 2023-09-25 at 12 26 24 Screenshot 2023-09-25 at 12 26 38

Screenshot 2023-09-25 at 12 27 14

Additional Info

No response

Environment

- FlutterFlow version: 3.10.6
- Platform: MacBook Pro M2 MACOS Ventura 13.2.1
- Browser name and version: Google Chrome 116.0.5845.187
- Operating system and version affected: Android v10
adialloo commented 11 months ago

same for me

MyTechAgent commented 11 months ago

I feel that they are experiencing a major incident. This was working up until 5:45 pm for me today.

Kum0-Iwazaru commented 11 months ago

I feel that they are experiencing a major incident. This was working up until 5:45 pm for me today.

Yeah, that was working since this morning, last night for some people of the community page, and till 3 hours for some other... (Reminder of the FlutterFlow Community page about this subject : https://community.flutterflow.io/project-settings/post/can-t-generate-launcher-icons-FDY1EdEgpezC6De#comment/i-previously-ran-the-flutter-upgrade-command-not-sure-if-it-had-e3mJIX5g003LlEa)

tothati90 commented 11 months ago

same here

MyTechAgent commented 11 months ago

That's a pain, poor buggers would be scrambling right now I bet. Was going to do some UAT tonight but guess not lol. Also, this started 5 hours and 15 minutes ago for me.

Kum0-Iwazaru commented 11 months ago

OK I think I found something :

  1. I'm on Mac, I opened my favicon.png with photo preview app.
  2. I exported favicon to PNG without A channel
  3. I went to https://compresspng.com/ to compress the PNG (Input: 49 KB, Output: 16 KB)
  4. I put the favicon on the FlutterFlow App (App Settings: App Assets)
  5. I downloaded the code
  6. Open project on Android Studio
  7. Run flutter pub add intl:^0.18.1
  8. Run flutter pub run flutter_launcher_icons:main

Got this : ` octup@mbp saihl % flutter pub add intl:^0.18.1
"intl" is already in "dependencies". Will try to update the constraint. Resolving dependencies...

• Creating default icons Android • Overwriting the default Android launcher icon with a new icon • Overwriting default iOS launcher icon with new icon Creating Icons for Web...
⚠️Requirements failed for platform Web. Skipped Creating Icons for Windows...
⚠️Windows config is not provided or windows.generate is false. Skipped... ⚠️Requirements failed for platform Windows. Skipped Creating Icons for MacOS...
⚠️Requirements failed for platform MacOS. Skipped ✓ Successfully generated launcher icons octup@mbp saihl % `

I will try some other ways. Suppose that the size is the key of this bug... (Not sure)

sauciucrazvan commented 11 months ago

Hey, had the same issue. If anyone is looking for a fix:

  1. Run flutter clean & flutter pub get
  2. Compress the image over at https://compresspng.com/
  3. Replace the image & run dart run flutter_launcher_icons:main once again.

This fixed it for me.

Kum0-Iwazaru commented 11 months ago

Hey, had the same issue. If anyone is looking for a fix:

  1. Run flutter clean & flutter pub get
  2. Compress the image over at https://compresspng.com/
  3. Replace the image & run dart run flutter_launcher_icons:main once again.

This fixed it for me.

Not working with me... Depending on size of file I suppose.

@sauciucrazvan What is the final size of your favicon ? (in pixels and in KB please) Because my input file is 821x821 px (41 KB) and output is 160x160 px (8.34 KB) and it didn't work

sauciucrazvan commented 11 months ago

Hey, had the same issue. If anyone is looking for a fix:

  1. Run flutter clean & flutter pub get
  2. Compress the image over at https://compresspng.com/
  3. Replace the image & run dart run flutter_launcher_icons:main once again.

This fixed it for me.

Not working with me... Depending on size of file I suppose.

@sauciucrazvan What is the final size of your favicon ? (in pixels and in KB please) Because my input file is 821x821 px (41 KB) and output is 160x160 px (8.34 KB) and it didn't work

Hey, the input image was a 512x512 .png, the output was the same size but compressed to 12KB from 32KB.

Kum0-Iwazaru commented 11 months ago

Ok, so I suppose the problems is not really the size... Because I've got images with lowest size than you and didn't work...

I saw that 4-bits colormap PNG works. I didn't know if it is always, but seems to work..

As said on the community page : Temporary solution is to downgrade flutter_launcher_icons to 0.11.0 and flutter_native_splash to 2.2.16

But this temp solution include that we cannot deploy from FlutterFlow App

Kum0-Iwazaru commented 11 months ago

I didn't know why, but I used iLoveImg.com, and the resulted image worked well...

  1. Go to : https://www.iloveimg.com/
  2. Compress image (base : 512x512, 25KB ) : Resulted image 512x512, 22.25 KB (not too compressed, compare to compresspng.com)
  3. Re-download code
  4. In the terminal : dart pub add intl:^0.18.1 (obligatory for me, don't know for other peoples with this problem...)
  5. In the terminal : dart pub get
  6. In the terminal : dart run flutter_launcher_icons:main

EDIT : I just tried with my steps above with different images, and it works everytime ! I don't know if it is the current real solution, but it works for me. (So deployment should be possible, because there is no more error when building)

agreaves commented 11 months ago

Hi @Kum0-Iwazaru, thank you for the bug report! And apologies for this issue, it looks like the image package updated and broke the flutter_launcher_icons package. We've deployed a fix for this so this should no longer be occurring and the above fixes should no longer be necessary.

Kum0-Iwazaru commented 11 months ago

Hey @agreaves, thanks for reply !