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
1.99k stars 396 forks source link

[BUG] Doesn't work with the flavors on the very_good create app template #466

Open aalex opened 1 year ago

aalex commented 1 year ago

:information_source: Info

Version: 0.12.0

:speech_balloon: Description

I am trying to set up some app icons, but I don’t see the right icons. We started from a very_good create app template, and then added some icons with flutter_launcher_icons, but the default icons from the very_good app template were not replaced by the ones generated by flutter_launcher_icons. How can we fix this? Here is a minimal prototype that reproduces the bug, and a but ticket that describes it, including all the technical details: https://github.com/artpluscodeinc/proto_very_good_flavor_icons/issues/1

:scroll: Pubspec.yaml

name: proto_very_good_flavor_icons
description: Prototype that allows to create custom application icons according to the flavor.
version: 1.0.0+1
publish_to: none

environment:
  sdk: ">=2.19.0 <3.0.0"

dependencies:
  bloc: ^8.1.1
  flutter:
    sdk: flutter
  flutter_bloc: ^8.1.2
  flutter_localizations:
    sdk: flutter
  intl: ^0.17.0

dev_dependencies:
  bloc_test: ^9.1.1
  flutter_launcher_icons: ^0.12.0
  flutter_test:
    sdk: flutter
  mocktail: ^0.3.0
  very_good_analysis: ^4.0.0

flutter:
  uses-material-design: true
  generate: true
lucasdidur commented 1 year ago

This happens because of the name of the files inside the Contents.json that is linked to the files that already come in the project.

Just delete the images and the Contents.json file and generate again.

MarkOSullivan94 commented 1 year ago

I've spent some time looking into why this is occurring for the Android app at least. It looks like the issue is to do with ic_launcher.xml within the mipmap-anydpi-v26 for both main and whatever flavor you're trying to run.

I setup a basic quick test with flutter_launcher_icons and found that if I delete both of these then ic_launcher.png which is generated by flutter_launcher_icons is used instead