fluttercommunity / flutter_launcher_icons

Flutter Launcher Icons - A package which simplifies the task of updating your Flutter app's launcher icon. Fully flexible, allowing you to choose what platform you wish to update the launcher icon for and if you want, the option to keep your old launcher icon in case you want to revert back sometime in the future. Maintainer: @MarkOSullivan94
https://pub.dev/packages/flutter_launcher_icons
MIT License
2.01k stars 406 forks source link

[BUG] Android: Black app launcher icon #578

Closed Navid-Rahman closed 1 month ago

Navid-Rahman commented 1 month ago

I'm using flutter_launcher_icons v0.14.0 to generate app icons for both Android and iOS. Despite providing a colored logo, the generated app icons are black in Android. But in iOS this is working fine. The logo is correctly formatted as a PNG file, and I've set the necessary configuration in pubspec.yaml, but the output remains incorrect.

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.0
  flutter_launcher_icons: ^0.14.0

flutter_launcher_icons:
  android: "launcher_icon"
  ios: true
  remove_alpha_ios: true
  image_path: "assets/logo/logo.png"
  min_sdk_android: 21

Flutter Doctor result:

Screenshot 2024-09-22 at 1 37 04 PM

Do you know if this is a bug from the latest update? Or am I doing something wrong?

ShuvamJaswal commented 1 month ago

Icon is a black box?

Navid-Rahman commented 1 month ago
Screenshot 2024-09-22 at 1 55 20 PM

On Android, the app icon is displaying incorrectly; as you can see in the screenshot. However, on iOS, the correct app icon is shown.

ShuvamJaswal commented 1 month ago

Facing the same issue. Not sure about IOS but I have a black icon in android.

MarkOSullivan94 commented 1 month ago

I'm using flutter_launcher_icons v0.14.0 to generate app icons for both Android and iOS. Despite providing a colored logo, the generated app icons are black in Android. But in iOS this is working fine. The logo is correctly formatted as a PNG file, and I've set the necessary configuration in pubspec.yaml, but the output remains incorrect.

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.0
  flutter_launcher_icons: ^0.14.0

flutter_launcher_icons:
  android: "launcher_icon"
  ios: true
  remove_alpha_ios: true
  image_path: "assets/logo/logo.png"
  min_sdk_android: 21

Flutter Doctor result: Screenshot 2024-09-22 at 1 37 04 PM

Do you know if this is a bug from the latest update? Or am I doing something wrong?

Does this work fine for v0.13.1?

What Android SDK version are you using?

Navid-Rahman commented 1 month ago

I noticed an inconsistency between the documentation and the example videos [Though the video is using v0.0.1] regarding the configuration for flutter_launcher_icons. In the example videos, the configuration is shown under flutter_icons, but the official documentation uses flutter_launcher_icons. The configuration didn't work until I switched it to flutter_icons, as mentioned in the videos.

On the video the requirements are mentioned under, flutter_icons:

Screenshot 2024-09-22 at 6 50 53 PM

On the documentation the requirements are mentioned under, flutter_launcher_icons:

Screenshot 2024-09-22 at 6 53 35 PM

The video suggestion worked fine for me.

Screenshot 2024-09-22 at 7 04 12 PM
Navid-Rahman commented 1 month ago

I'm using flutter_launcher_icons v0.14.0 to generate app icons for both Android and iOS. Despite providing a colored logo, the generated app icons are black in Android. But in iOS this is working fine. The logo is correctly formatted as a PNG file, and I've set the necessary configuration in pubspec.yaml, but the output remains incorrect.

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.0
  flutter_launcher_icons: ^0.14.0

flutter_launcher_icons:
  android: "launcher_icon"
  ios: true
  remove_alpha_ios: true
  image_path: "assets/logo/logo.png"
  min_sdk_android: 21

Flutter Doctor result: Screenshot 2024-09-22 at 1 37 04 PM Do you know if this is a bug from the latest update? Or am I doing something wrong?

Does this work fine for v0.13.1?

What Android SDK version are you using?

I haven't tested this with version 0.13.1 specifically. However, I did use version 0.13.1 in one of my projects a few days ago and did not encounter any issues at that time.

ShuvamJaswal commented 1 month ago

@MarkOSullivan94 I found the issue in my case, version 1.14.0 is creating a folder mipmap-anydpi-v26 in res folder which contains some sort of xml files, deleting that folder fixed this for me.

MarkOSullivan94 commented 1 month ago

I noticed an inconsistency between the documentation and the example videos [Though the video is using v0.0.1] regarding the configuration for flutter_launcher_icons. In the example videos, the configuration is shown under flutter_icons, but the official documentation uses flutter_launcher_icons. The configuration didn't work until I switched it to flutter_icons, as mentioned in the videos.

On the video the requirements are mentioned under, flutter_icons: Screenshot 2024-09-22 at 6 50 53 PM

On the documentation the requirements are mentioned under, flutter_launcher_icons: Screenshot 2024-09-22 at 6 53 35 PM

The video suggestion worked fine for me. Screenshot 2024-09-22 at 7 04 12 PM

Both flutter_icons and flutter_launcher_icons should work, did you do a flutter clean before flutter pub get?

Navid-Rahman commented 1 month ago

I noticed an inconsistency between the documentation and the example videos [Though the video is using v0.0.1] regarding the configuration for flutter_launcher_icons. In the example videos, the configuration is shown under flutter_icons, but the official documentation uses flutter_launcher_icons. The configuration didn't work until I switched it to flutter_icons, as mentioned in the videos. On the video the requirements are mentioned under, flutter_icons: Screenshot 2024-09-22 at 6 50 53 PM On the documentation the requirements are mentioned under, flutter_launcher_icons: Screenshot 2024-09-22 at 6 53 35 PM The video suggestion worked fine for me. Screenshot 2024-09-22 at 7 04 12 PM

Both flutter_icons and flutter_launcher_icons should work, did you do a flutter clean before flutter pub get?

Yupp. I tried that also. I even uninstalled the app and then again ran the program.

rohanots commented 1 month ago

I degraded the package version to this flutter_launcher_icons: "^0.13.1" Worked like a charm

bjmc commented 1 month ago

Are we sure this issue should be closed? I think I just encountered this glitch. As suggested by @ShuvamJaswal, deleting the mipmap-anydpi-v26 resolved the problem, but it seems like flutter_launcher_icons v0.14.1 is still generating output that breaks the launcher icon on at least some Android devices.

UMattiaBano commented 1 month ago

Are we sure this issue should be closed? I think I just encountered this glitch. As suggested by @ShuvamJaswal, deleting the mipmap-anydpi-v26 resolved the problem, but it seems like flutter_launcher_icons v0.14.1 is still generating output that breaks the launcher icon on at least some Android devices.

Agree with it, issue still present on Android (I've tried 12 and 14, both have the issue) on 0.14.0 and 0.14.1

And96 commented 1 month ago

Which resolution should we use for this image? **image_path: "assets/logo/logo.png"**

After last update, my icon become really small. I didnt change anything, same image, just update the package. With the old version, the icon was twice as large!

Quardah commented 1 month ago

@MarkOSullivan94 I found the issue in my case, version 1.14.0 is creating a folder mipmap-anydpi-v26 in res folder which contains some sort of xml files, deleting that folder fixed this for me.

i had this exact same problem with 1.14.1 and found the same answer here : https://stackoverflow.com/questions/79065420/suspected-flutter-launcher-icons-0-14-1-causing-fatal-exception-wmshell-splashw

another issue is since i fixed it now my app icon is stuck with a white outline. i am unsure what caused this but it was not the case before having to delete that folder.

akpabiojnr01 commented 1 week ago

I deleted the mipmap-anydpi-v26 folder that contained an xml file in android/app/src/main/res folder