Harry.R Jafari
Harry.R Jafari

Reputation: 291

flutter_launcher_icons package is not changing the launcher icons in android after upgrading to the latest flutter version

its my code in pubspec.yaml file:

    dev_dependencies:
      flutter_test:
        sdk: flutter
      flutter_lints: ^4.0.0
      bloc_test:
      hive_generator:
      build_runner:
      change_app_package_name: ^1.1.0
      flutter_launcher_icons: ^0.14.1

    flutter_launcher_icons:
      android: "launcher_icon"
      ios: true
      remove_alpha_ios: true
      image_path: "assets/images/logodark.png"
      min_sdk_android: 24 

anfter runningdart run flutter_launcher_icons command it says that the icon changes and no error. but when i run it on a real android device no icon is there.

its happend after the uprade the flutter to the latest version

Upvotes: 3

Views: 2531

Answers (3)

Harry.R Jafari
Harry.R Jafari

Reputation: 291

After lots of researching i found the solution:

Video Solution: https://www.youtube.com/watch?v=ZhOJ2FunYg8

I added 2 more parameters to the flutter_launcher_icons Now it look like this:

    flutter_launcher_icons:
      android: "launcher_icon"
      ios: true
      remove_alpha_ios: true
      image_path: "assets/images/logodark.png"
      min_sdk_android: 24 # android min sdk min:16, default 21
      adaptive_icon_background: "#ffffff" # You can use a color or image for the background
      adaptive_icon_foreground: "assets/images/logodark.png" # For adaptive icons on Android

and then i run flutter clean and then flutter pub get and then flutter pub run flutter_launcher_icons:main

and now its working 100% fine on IOS and android for me.

I hope your problem get fixed as well

Upvotes: 6

Anu Desai
Anu Desai

Reputation: 435

Sometimes, cleaning the project and rebuilding it can resolve such issues.

flutter clean
flutter pub get
flutter pub run flutter_launcher_icons
flutter build apk

Make sure that the AndroidManifest.xml file is correctly referencing the new icon. It should look something like this:

<application
    android:icon="@mipmap/ic_launcher"
    android:label="YourAppName"
    ...>

This may help you to resolve it.

Upvotes: 0

Related Questions