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.98k stars 393 forks source link

[BUG] Android Adaptive Icons Not Generated #448

Open FrBernad opened 1 year ago

FrBernad commented 1 year ago

:information_source: Info

Version: e.g. v^0.11.0

:speech_balloon: Description

The adaptive icons are not being generated inside the mipmap folders using a valid adaptive configuration.

:scroll: Pubspec.yaml

flutter_icons:
  image_path: "assets/images/launcher_icon_text_only.png"

  android: true
  adaptive_icon_foreround: "assets/images/launcher_icon_fg.png"
  adaptive_icon_background: "assets/images/launcher_icon_bg.png"
  min_sdk_android: 16

  ios: true
  remove_alpha_ios: true
mariopepe commented 1 year ago

Same for me, do we have any solution to this?

shadabunique commented 1 year ago

I'm also having the same problem.

Myzel394 commented 1 year ago

any news on this? :(

RatakondalaArun commented 1 year ago

@Myzel394 Can you please run your command with -v flag and share the log

Myzel394 commented 1 year ago

@RatakondalaArun sure, here's the output:

[myzel394@device locus]$ flutter pub run flutter_launcher_icons -v
[   +7 ms] executing: uname -m
[   +9 ms] Exit code 0 from: uname -m
[        ] x86_64
[        ] executing: [/home/myzel394/snap/flutter/common/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +3 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0
[        ] executing: [/home/myzel394/snap/flutter/common/flutter/] git tag --points-at 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0
[  +12 ms] Exit code 0 from: git tag --points-at 90c64ed42ba53a52d18f0cb3b17666c8662ed2a0
[        ] 3.7.8
[   +7 ms] executing: [/home/myzel394/snap/flutter/common/flutter/] git rev-parse --abbrev-ref --symbolic @{upstream}
[   +3 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{upstream}
[        ] origin/stable
[        ] executing: [/home/myzel394/snap/flutter/common/flutter/] git ls-remote --get-url origin
[   +1 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +13 ms] executing: [/home/myzel394/snap/flutter/common/flutter/] git rev-parse --abbrev-ref HEAD
[   +3 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[  +14 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +1 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +31 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[  +80 ms] executing: /home/myzel394/snap/flutter/common/flutter/bin/cache/dart-sdk/bin/dart __deprecated_pub --color run flutter_launcher_icons -v
  ════════════════════════════════════════════
     FLUTTER LAUNCHER ICONS (v0.13.1)                               
  ════════════════════════════════════════════

[     0.002s] Received args [-v]
• Creating default icons Android
• Overwriting the default Android launcher icon with a new icon
• Creating adaptive icons Android
• Updating colors.xml with color for adaptive icon background
• Overwriting default iOS launcher icon with new icon
[     1.332s] No platform provided

✓ Successfully generated launcher icons
[+1842 ms] "flutter run" took 1,970ms.
[ +132 ms] ensureAnalyticsSent: 128ms
[        ] Running 0 shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 0

Maybe there's also a problem with the icon? If you would like to see it, you can find it here: https://github.com/Myzel394/locus/blob/master/assets/launcher-icon-android.png

Myzel394 commented 1 year ago

Okay I added the icon manually now. Here's what you need to do:

  1. Read https://developer.android.com/develop/ui/views/launch/icon_design_adaptive, this contains basically everything you need to know about monochrome icons
  2. Create your icon based on the doc. You need a ratio of 72x72 for your icon and a background size of 108x108.
  3. Rename your file to ic_launcher_monochrome
  4. Go to https://www.appicon.co/#image-sets, make sure you are on "Image Sets" and upload your file
  5. You only need "Android" to be checked
  6. Download & extract your icons
  7. Open the extracted folder, then open android, you should see folders like drawable-hdpi, drawable-mdpi etc.
  8. Copy all folders into your Flutter project under android/app/src/main/res - the res folder should already contain the same folders (drawable-hdpi, drawable-mdpi etc.), if not, you are probably in the wrong folder
  9. Open android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  10. Add <monochrome android:drawable="@drawable/ic_launcher_monochrome"/> just before the closing tag of <adaptive-icon>

Your ic_launcher.xml should look something like this:

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
  <background android:drawable="@color/ic_launcher_background"/>
  <foreground android:drawable="@drawable/ic_launcher_foreground"/>
  <monochrome android:drawable="@drawable/ic_launcher_monochrome"/>
</adaptive-icon>
hussenIbrahim commented 1 year ago

Best website to generate icons link