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 393 forks source link

[BUG] Flavors not being detected #279

Open Zazo032 opened 3 years ago

Zazo032 commented 3 years ago

:information_source: Info

Version: 0.9.1

:speech_balloon: Description

We're using flavors for our app, so instead of adding the flutter_icons to pubspec.yaml, following the flavor's section on README.md, we created 2 files: flutter_launcher_icons-development.yaml and flutter_launcher_icons-production.yaml, at the same project level as pubspec.yaml.

Error log

flutter pub run flutter_launcher_icons:main
  ════════════════════════════════════════════
     FLUTTER LAUNCHER ICONS (v0.9.1)
  ════════════════════════════════════════════

✗ ERROR: NoConfigFoundException
Check that your config file `flutter_launcher_icons.yaml` has a `flutter_icons` section
pub finished with exit code 1

:scroll: pubspec.yaml

name: <elided>
description: <elided>
publish_to: none
version: 0.0.3+6

environment:
  sdk: ">=2.13.0 <3.0.0"

dependencies:
  <elided>

dev_dependencies:
  bloc_test: ^8.1.0
  flutter_launcher_icons: ^0.9.1
  flutter_native_splash: ^1.2.1
  flutter_test:
    sdk: flutter
  very_good_analysis: ^2.2.0

flutter:
  assets:
    - assets/auth/
  generate: true
  uses-material-design: true

:scroll: flutter_launcher_icons-development.yaml

flutter_icons:
  android: true
  image_path: "assets/native/icon-development.png"

:scroll: flutter_launcher_icons-production.yamll

flutter_icons:
  android: true
  image_path: "assets/native/icon-development.png"
MarkOSullivan94 commented 3 years ago

Hi @Zazo032 in the current version you need to specify the config file to use when using flavors

E.g. flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons-development.yaml