fluttercommunity / fluttercommunity/flutter_launcher_icons

Invalid <color> for given resource value

Open Beginner friendly
#673 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Dart
Stars
2.1k
Forks
426
PR merge metrics
No merged PRs in 30d

Description

### :information_source: Info

flutter_launcher_icons: ^0.14.4

### :speech_balloon: Description

When generating Android launcher icons using `flutter_launcher_icons: ^0.14.4`, the package generates an invalid color resource in `android/app/src/main/res/values/colors.xml`.

The generated file contains:

```xml
ffffff
```

However, Android requires the hexadecimal color value to include the `#` prefix:

```xml
#ffffff
```

Because of this, the Flutter Android build fails with the following error:

```text
Invalid for given resource value.
```

The error occurs during:

```text
:app:mergeDebugResources
```

The merged Android resource file contains:

```xml
ffffff
```

After manually changing it to:

```xml
#ffffff
```

the project builds successfully.

This appears to be related to the launcher icon generation process, where the generated `ic_launcher_background` color is missing the `#` prefix.

### :scroll: Pubspec.yaml

```yaml
flutter_launcher_icons:
android:
ios:
image_path:
```

### Expected behavior

The generated `colors.xml` should contain a valid Android color:

```xml
#ffffff
```

### Actual behavior

The generated `colors.xml` contains:

```xml
ffffff
```

which causes Android resource compilation to fail.

### Environment

* Flutter: 3.44.5
* Dart: 3.12.2
* Android Gradle Plugin: 9.0.1
* Gradle: 9.1.0
* `flutter_launcher_icons`: 0.14.4
* Android device: Infinix X6836
* OS: Windows

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing launcher icon generation with the provided flutter_launcher_icons configuration and inspect android/app/src/main/res/values/colors.xml and the merged Android resource output. Trace the launcher icon generation process to the source of ic_launcher_background, then verify that a generated project builds successfully during :app:mergeDebugResources with a valid color value.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, dart, flutter
Domain
build-system, mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.