fluttercommunity / fluttercommunity/flutter_launcher_icons

[BUG] launch_icon with flavors not working

Open
#385 31 comments 7 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
2.1k
Forks
426
PR merge metrics
No merged PRs in 30d

Description

### :information_source: Info

Version: `0.9.3`
Flutter version: 3.0.2

### :speech_balloon: Description

We have been using this package for a while, it worked perfectly until a couple of weeks ago. I've checked everything and it all seems correct. The issue is that when installing the app it always show the default launcher_icon instead of the one defined in `flutter_launcher_icons-.yaml`

I've got 3 flavours, pre, prod and sandbox. But if I run `flutter run --flavor sandbox`, the app shows the default icon. Not the one defined in that flavor configuration file.

I've run `flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons-sandbox.yaml` but it does not solve anything. Any idea what could be going on?

I had it set up with adaptive icons, but for testing, I tried with `image_path` instead.

### :scroll: Pubspec.yaml

```dart
name: rec
description: Rec Barcelona app.
publish_to: 'none'
version: 2.3.0+81

environment:
sdk: '>=2.12.0 <3.0.0'

dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
flutter_secure_storage: ^5.0.2
flutter_spinkit: ^5.1.0
flutter_easyloading: ^3.0.5
flutter_speed_dial: ^4.6.6
flutter_svg: ^0.23.0+1
rec_api_dart: ^1.4.0-alpha.5
# rec_api_dart:
# path: /Users/keff_work/Documents/dev/work/REC/rec_api_dart
contacts_service: ^0.6.3
country_code_picker: ^2.0.2
cupertino_icons: ^1.0.4
dio: ^4.0.4
geocoding: ^2.0.1
google_maps_flutter: ^2.1.6
qr_flutter: ^4.0.0
mobile_scanner: ^2.0.0
http: ^0.13.4
http_interceptor: ^1.0.2
intl: ^0.17.0
package_info: ^2.0.2
permission_handler: ^8.3.0
provider: ^6.0.1
sentry_flutter: ^6.5.1
share: ^2.0.4
shared_preferences: ^2.0.9
timeago: ^3.1.0
url_launcher: ^6.1.2
webview_flutter: ^2.3.1
image_picker: ^0.8.4+4
path: ^1.8.0
path_provider: ^2.0.9
pinput: ^2.2.9
location: ^4.4.0
collection: ^1.15.0-nullsafety.4
flutter_dotenv: ^5.0.2
modal_bottom_sheet: ^2.0.1
styled_text: ^5.1.0

dev_dependencies:
flutter_test:
sdk: flutter
test: ^1.17.10
lints: ^1.0.1
flutter_launcher_icons: ^0.9.3
faker: ^2.0.0
mockito: ^5.0.16
dart_code_metrics: ^4.15.2

flutter:
assets:
- assets/
- assets/adaptive_app_icon/
- assets/custom-icons/
- assets/markers/
- assets/banners/
- assets/cards/
- i18n/ca.json
- i18n/en.json
- i18n/es.json
- env/.env
uses-material-design: true
```

### Flavor file example
`flutter_launcher_icons-pre.yaml`
```yml
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/adaptive_app_icon/pre.png"
remove_alpha_ios: true
```

### build.gradle
```gradle
android {
flavorDimensions "default"
productFlavors {
sandbox {
dimension "default"
applicationId "com.barcelona.sandbox"
versionNameSuffix "-sandbox"
manifestPlaceholders = [appName: "[SANDBOX] RecBarcelona"]
}

pre {
dimension "default"
applicationId "com.barcelona.prec"
versionNameSuffix "-pre"
manifestPlaceholders = [appName: "[INT] RecBarcelona"]
}

prod {
dimension "default"
applicationId "com.barcelona.rec"
manifestPlaceholders = [appName: "[INT] RecBarcelona"]
}
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.