fluttercommunity / fluttercommunity/flutter_launcher_icons

bug: Android duplicate launcher resources + adaptive/profile icon not generated correctly

Open
#663 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

Here is a single, combined GitHub issue message.
You can copy–paste this directly without any changes.

:bug: Android duplicate launcher resources + adaptive/profile icon not generated correctly

:information_source: Info
• Package: flutter_launcher_icons
• Version: ^0.14.4
• Flutter: 3.38.5 (stable)
• Dart: bundled with Flutter
• OS: macOS 26.1 (darwin-arm64)
• Android SDK: 36.1.0

:speech_balloon: Description

When generating launcher icons using flutter_launcher_icons, Android build fails due to duplicate resources, and additionally the Android adaptive/profile icon is not configured correctly.

1️⃣ Duplicate resource error (Build failure)
After running:

dart run flutter_launcher_icons

Flutter reports success, but Android build fails with the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> [mipmap-mdpi-v4/ic_launcher]
.../android/app/src/main/res/mipmap-mdpi/ic_launcher.webp
[mipmap-mdpi-v4/ic_launcher]
.../android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Error: Duplicate resources

[mipmap-hdpi-v4/ic_launcher]
.../mipmap-hdpi/ic_launcher.webp
.../mipmap-hdpi/ic_launcher.png
Error: Duplicate resources

[mipmap-xhdpi-v4/ic_launcher]
.../mipmap-xhdpi/ic_launcher.webp
.../mipmap-xhdpi/ic_launcher.png
Error: Duplicate resources

[mipmap-xxhdpi-v4/ic_launcher]
.../mipmap-xxhdpi/ic_launcher.webp
.../mipmap-xxhdpi/ic_launcher.png
Error: Duplicate resources

[mipmap-xxxhdpi-v4/ic_launcher]
.../mipmap-xxxhdpi/ic_launcher.webp
.../mipmap-xxxhdpi/ic_launcher.png
Error: Duplicate resources

Root cause observed:
• The tool generates both .png and .webp icons with the same name in the same mipmap folders.
• Android does not allow duplicate resource names.

Temporary workaround:
• Manually delete all duplicated .webp (or .png) files.
• This fixes the build, but should not be required.

2️⃣ Android adaptive / profile icon not generated correctly
Even after resolving the duplicate resource issue:
• The Android adaptive/profile icon does not work properly.
• On some launchers, the app still shows:
• A default icon, or
• An incorrect/legacy icon

To fix this, we must manually open Android Studio → Image Asset and recreate the launcher icon.

Expected behavior:
• flutter_launcher_icons should correctly generate:
• mipmap-anydpi-v26/ic_launcher.xml
• ic_launcher_foreground
• ic_launcher_background
• No manual Android Studio steps should be required.

:scroll: Pubspec.yaml configuration

dev_dependencies:
flutter_launcher_icons: ^0.14.4

flutter_launcher_icons:
android: "ic_launcher"
ios: true
remove_alpha_ios: true
image_path: "assets/icons/app_icon.png"

:clipboard: Flutter doctor output

[✓] Flutter (Channel stable, 3.38.5, on macOS 26.1 25B78 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.1.1)
[✓] Chrome - develop for the web
[✓] Connected device (4 available)
[✓] Network resources

:exclamation: Impact
• Android build fails due to duplicate resources
• Adaptive/profile icons are inconsistent
• Requires manual Android Studio intervention
• Breaks automated CI/CD workflows

:white_check_mark: Expected result
• No duplicate .png / .webp files generated
• Correct adaptive/profile launcher icons generated automatically
• Android build succeeds without manual cleanup

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.