Open GrahamDi opened 1 year ago
After almost a day worth of trying to make exactly this work, I stumbled across this issue. I'm having exactly the same issue. This makes it impossible to automate the flavored app icon generating script, thus commenting here to raise awarness.
I'm not entirely sure on how to proceed with this given the examples provided will override the main/res folder, no matter which path is provided in the android attribute. Same as for OP, Android/iOS are mainly require.
I think it's worth updating this thread:
@GrahamDi in case you didn't find a working solution, it would seem this tutorial indeed covers it: https://dev.to/stack-labs/flutter-flavors-launcher-icons-made-simple-336j
Creating separate yaml files for each flavor indeed updates each folder respectively. They should be named:
flutter_launcher_icons-FLAVOR.yaml
And run each one by calling
flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons*
The documentation should be updated to cover this.
That being said, I'm also tagging @MarkOSullivan94. :)
Have you tried adding the flavor yml files to a folder? The command, dart run flutter_launcher_icons -f "flutter_launcher_icons/flutter_launcher_icons*"
, does not generate icons in each folder respectively. It chooses one of the files and uses it as the default.
:speech_balloon: Description
In my implementation of flavors (which I doubt is unique to me), in android I have separate 'res' folders (containing the mipmap folders) for 'dev' and 'prod'.
'dev' has the following path:
"<project name>/android/app/src/dev/res"
in Windows. 'prod' uses the 'res' folder in 'main'.I typically use the same launch icon name for dev and prod and my build process sorts out which 'res' folder to use for the launch icons when I build for dev or prod.
I had assumed that I would simply be able to provide the path to 'res' together with the icon name as the 'android;' or 'iOS:' attribute - in fact the README.MD suggests I can...
However, when I try to add this as the android: attribute
android: "android/app/src/dev/res/launcher_icon"
I get the following error message:It even gives this error if I add the '.png' to just the icon name, which is at odds with what your README.MD states above.
Am I doing something wrong i.e. should it work, is it a bug, or is it a missing feature? If it is the former then I would ask that the READ.ME be updated to show an example of using the path in the android and iOS attributes, and also to not say that '.png' can be used in the ican name.
Thanks a lot.
:question: Platform
I would suggest it is applied to all platforms, however, selfishly I only need it for Android ans iOS. :-)