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] ios icon not generated with multi flavor #491

Open lucagiordano-visia opened 1 year ago

lucagiordano-visia commented 1 year ago

I'm trying to generate app icons with 2 flavor. On android all good. On ios it doesn't, it still shows the old icon app that was set before i did the 2 flavor.

I don't know if is that "No platform provided" message the problem

flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons-criocabin.yaml Building package executable... (1.8s) Built flutter_launcher_icons:main. This command is deprecated and replaced with "flutter pub run flutter_launcher_icons" ════════════════════════════════════════════ FLUTTER LAUNCHER ICONS (v0.13.1)
════════════════════════════════════════════

Flavor: criocabin • Creating default icons Android • Overwriting the default Android launcher icon with a new icon • Creating adaptive icons Android • Updating colors.xml with color for adaptive icon background • Building iOS launcher icon for criocabin No platform provided

Flavor: evco • Creating default icons Android • Overwriting the default Android launcher icon with a new icon • Creating adaptive icons Android • Updating colors.xml with color for adaptive icon background • Building iOS launcher icon for evco No platform provided

✓ Successfully generated launcher icons for flavors

ynnob commented 1 year ago

Hey running into the same issue. the command seems to ignore the -f attribute and executes only the flavor files but does not execute the "default" flavor.

petitJAM commented 1 year ago

I just ran into this as well. What you'll want to do, is go into the ios/ folder and delete the default icon (probably ios/Runner/Assets.xcassets/AppIcon.appiconset/).

Then open up the iOS subproject in Xcode and open Runner.xcodeproj > Build Settings > Search for "Primary App Icon Set Name". In there, update all the values for each flavor to AppIcon-flavorname (looks like AppIcon-criocabin and AppIcon-evco for the flavors above). Then open up the Runner target in that same file and repeat those same steps in there.

I'm not really an iOS developer, so I'm not 100% confident that's everything that needs to be done, but it seems to be working for me 🤷

nenzan commented 1 year ago

I just ran into this as well. What you'll want to do, is go into the ios/ folder and delete the default icon (probably ios/Runner/Assets.xcassets/AppIcon.appiconset/).

Then open up the iOS subproject in Xcode and open Runner.xcodeproj > Build Settings > Search for "Primary App Icon Set Name". In there, update all the values for each flavor to AppIcon-flavorname (looks like AppIcon-criocabin and AppIcon-evco for the flavors above). Then open up the Runner target in that same file and repeat those same steps in there.

I'm not really an iOS developer, so I'm not 100% confident that's everything that needs to be done, but it seems to be working for me 🤷

This is legit answer, resolve my problem. thanks!

jukka-palomaki commented 1 year ago

For me it helped to add all platforms, also web, windows and macos (even if I am just using Android and iOS at least for now):

  web:
    generate: true
    image_path: "path/to/image.png"
    background_color: "#hexcode"
    theme_color: "#hexcode"
  windows:
    generate: true
    image_path: "path/to/image.png"
    icon_size: 48 # min:48, max:256, default: 48
  macos:
    generate: true
    image_path: "path/to/image.png"

I also applied @nenzan 's instructions first. I am not sure if they affected too that it started to work for me.

YudizAndroidNareshP commented 1 year ago

Target’s Build Settings and search for primary app icon. Here we set the correct app icon for each schema. Runner-> Build Settings -> Primary App Icon Set Name