skip to Main Content

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

2

Answers


  1. Chosen as BEST ANSWER

    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 or dart pub run flutter_launcher_icons

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

    I hope your problem get fixed as well


  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search