Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Android I See only a black Circle as icon #600

Open
agorji79 opened this issue Oct 13, 2024 · 25 comments
Open

In Android I See only a black Circle as icon #600

agorji79 opened this issue Oct 13, 2024 · 25 comments
Labels

Comments

@agorji79
Copy link

ℹ️ Info

Flutter 3.24.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5874a72aa4 (8 weeks ago) • 2024-08-20 16:46:00 -0500
Engine • revision c9b9d5780d
Tools • Dart 3.5.1 • DevTools 2.37.2

💬 Description

Hello,

For IOS works every thing with the icon as I expect. But for android I see a black Circle in the Simulator (Pixel_3a_API_34_extension_level_7_arm64_v8a and Medium Phone API 34).

How can I fix it?

📜 flutter_launcher_icons.yaml

dev_dependencies:
  flutter_launcher_icons: "^0.14.1"

# flutter pub run flutter_launcher_icons
flutter_launcher_icons:
  image_path: "assets/icon/Ronaldo_icon_1.png"
  image_path_android: "assets/icon/Ronaldo_icon_1.png"
  image_path_ios: "assets/icon/Ronaldo_icon_1.png"

  remove_alpha_ios: true
  background_color_ios: "#ffffff"

  android: "launcher_icon"
  # image_path_android: "assets/icon/icon.png"
  min_sdk_android: 21 # android min sdk min:16, default 21
  # adaptive_icon_background: "assets/icon/background.png"
  # adaptive_icon_foreground: "assets/icon/foreground.png"
  # adaptive_icon_monochrome: "assets/icon/monochrome.png"

  ios: true
  # image_path_ios: "assets/icon/icon.png"
  remove_alpha_channel_ios: true
  # image_path_ios_dark_transparent: "assets/icon/icon_dark.png"
  # image_path_ios_tinted_grayscale: "assets/icon/icon_tinted.png"
  # desaturate_tinted_to_grayscale_ios: true

  web:
    generate: true
    image_path: "assets/icon/Ronaldo_icon_1.png"

    background_color: "#hexcode"
    theme_color: "#hexcode"

  windows:
    generate: true
    image_path: "assets/icon/Ronaldo_icon_1.png"
    icon_size: 48 # min:48, max:256, default: 48

  macos:
    generate: true
    image_path: "assets/icon/Ronaldo_icon_1.png"

📜 Pubspec.yaml

name: my_try_1
description: "An App for my son, Sam Gorji"
publish_to: 'none'
version: 0.1.0

environment:
  sdk: '>=3.4.4 <4.0.0'

dependencies:
  flutter:
    sdk: flutter
  #flutter pub add material_design_icons_flutter
  flutter_launcher_icons: ^0.14.1
  material_design_icons_flutter: ^7.0.7296

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^3.0.0

flutter:
  uses-material-design: true

flutter_icons:
  image_path_android: "assets/icon/Ronaldo_icon_1.png"
  image_path_ios: "assets/icon/Ronaldo_icon_1.png"
  android: true
  ios: true
  image_path: "assets/icon/Ronaldo_icon_1.png"

After installing I see this output:

$ flutter pub get
dart run flutter_launcher_icons
Resolving dependencies... 
Downloading packages... 
  collection 1.18.0 (1.19.0 available)
  flutter_lints 3.0.2 (5.0.0 available)
  leak_tracker 10.0.5 (10.0.7 available)
  leak_tracker_flutter_testing 3.0.5 (3.0.8 available)
  lints 3.0.0 (5.1.0 available)
  material_color_utilities 0.11.1 (0.12.0 available)
  meta 1.15.0 (1.16.0 available)
  stack_trace 1.11.1 (1.12.0 available)
  string_scanner 1.2.0 (1.3.0 available)
  test_api 0.7.2 (0.7.3 available)
  vm_service 14.2.5 (14.3.0 available)
Got dependencies!
11 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Building package executable... 
Built flutter_launcher_icons:flutter_launcher_icons.
  ════════════════════════════════════════════
     FLUTTER LAUNCHER ICONS (v0.14.1)                               
  ════════════════════════════════════════════
  
• Creating default icons Android
• Adding a new Android launcher icon
• Creating mipmap xml file Android
• Overwriting default iOS launcher icon with new icon
Creating Icons for Web...              done
Creating Icons for Windows...          done
Creating Icons for MacOS...            done

✓ Successfully generated launcher icons
@agorji79 agorji79 added the bug label Oct 13, 2024
@shaheer-hybreed
Copy link

Here also same

1 similar comment
@adham-ashraf77
Copy link

Here also same

@BenSalemOumaima
Copy link

same problem

@wdelamin97
Copy link

same problem flutter 3.24.1 stable

@wdelamin97
Copy link

problem fixed after downgrade package to 0.13.1
flutter_launcher_icons: ^0.13.1

my file looks like

dev_dependencies:
  flutter_launcher_icons: "^0.13.1"

flutter_launcher_icons:
  android: "launcher_icon"
  ios: true
  image_path: "assets/img/icon.png"
  min_sdk_android: 21 # android min sdk min:16, default 21
  web:
    generate: false
    image_path: "path/to/image.png"
    background_color: "#hexcode"
    theme_color: "#hexcode"
  windows:
    generate: false
    image_path: "path/to/image.png"
    icon_size: 48 # min:48, max:256, default: 48
  macos:
    generate: false
    image_path: "path/to/image.png"

you need to run

flutter pub get
dart run flutter_launcher_icons

@Bow-T
Copy link

Bow-T commented Oct 13, 2024

Same problem

@Sarvesh223
Copy link

same problem

@WhistlerChoi
Copy link

WhistlerChoi commented Oct 14, 2024

Solved) If you declare adaptive_icon_background, adaptive_icon_foreground, the icons will be created as normal.

@DaliaPinto23
Copy link

Same problem using flutter 3.24.3

@DaliaPinto23
Copy link

DaliaPinto23 commented Oct 14, 2024

Solved) If you declare adaptive_icon_background, adaptive_icon_foreground, the icons will be created as normal.

It solved my problem, thank you

@FahimHoque
Copy link

Solved) If you declare adaptive_icon_background, adaptive_icon_foreground, the icons will be created as normal.

This solved the issue. downgrading to 0.13.1 did not help in my case

@agorji79
Copy link
Author

agorji79 commented Oct 15, 2024

Solved) If you declare adaptive_icon_background, adaptive_icon_foreground, the icons will be created as normal.

Thank you @WhistlerChoi! It solved my problem too..

@agorji79 agorji79 changed the title In Android I See only a black Circle a icon In Android I See only a black Circle as icon Oct 15, 2024
@rafaelgcs
Copy link

rafaelgcs commented Oct 17, 2024

Solved) If you declare adaptive_icon_background, adaptive_icon_foreground, the icons will be created as normal.

I put in yaml file
adaptive_icon_background: "#FFFFFF"
and
adaptive_icon_foreground: "path/to/icon.png"

And solved the problem, thank you @WhistlerChoi !

@daybson
Copy link

daybson commented Oct 19, 2024

Solved) If you declare adaptive_icon_background, adaptive_icon_foreground, the icons will be created as normal.

Solved. Remember to re-run the package to update the icons/files:

dart run flutter_launcher_icons

@Ali-peu
Copy link

Ali-peu commented Oct 22, 2024

Решено) Если вы объявите adaptive_icon_background, adaptive_icon_foreground, иконки будут созданы как обычно.

Thank you

@GustavoMartins123
Copy link

G

Solved) If you declare adaptive_icon_background, adaptive_icon_foreground, the icons will be created as normal.

Solved. Remember to re-run the package to update the icons/files:

dart run flutter_launcher_icons

GOD BLESS YOU, THX.

@juanhuerta
Copy link

Solved) If you declare adaptive_icon_background, adaptive_icon_foreground, the icons will be created as normal.

Thanks! that worked for me!

@komiljonovshohjahon
Copy link

Solved) If you declare adaptive_icon_background, adaptive_icon_foreground, the icons will be created as normal.

I put in yaml file adaptive_icon_background: "#FFFFFF" and adaptive_icon_foreground: "path/to/icon.png"

And solved the problem, thank you @WhistlerChoi !

Solved the issue, thanks

@kotaroyamazaki
Copy link

same problem

@kotaroyamazaki
Copy link

Solved) If you declare adaptive_icon_background, adaptive_icon_foreground, the icons will be created as normal.

I put in yaml file adaptive_icon_background: "#FFFFFF" and adaptive_icon_foreground: "path/to/icon.png"

And solved the problem, thank you @WhistlerChoi !

Thanks. solved

@YesThatGy
Copy link

Solved) If you declare adaptive_icon_background, adaptive_icon_foreground, the icons will be created as normal.

Solved. Remember to re-run the package to update the icons/files:

dart run flutter_launcher_icons

This worked for me too. So, the issue that remains is that either:

  1. The documentation needs to be updated to specify that these fields are required on Android, or

  2. The package needs to be updated so that these are not required any longer.

@PierreEhab
Copy link

Solved) If you declare adaptive_icon_background, adaptive_icon_foreground, the icons will be created as normal.

I put in yaml file adaptive_icon_background: "#FFFFFF" and adaptive_icon_foreground: "path/to/icon.png"

And solved the problem, thank you @WhistlerChoi !

This solved it, but don't forget to "flutter clean" and re run the package with "dart run flutter_launcher_icons"

@jitendrakohar
Copy link

jitendrakohar commented Nov 4, 2024

still , facing the same issue, the icon is totally appearing black:

E/AndroidRuntime(13560): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.draw(android.graphics.Canvas)' on a null object reference E/AndroidRuntime(13560): at com.android.wm.shell.startingsurface.SplashscreenIconDrawableFactory$AdaptiveForegroundDrawable.draw(go/retraceme 19693c2b0a8439b7183751b64d60893829dbf56dc1e08e0669fc0cfc55754948:6) E/AndroidRuntime(13560): at com.android.wm.shell.startingsurface.SplashscreenIconDrawableFactory$ImmobileIconDrawable.preDrawIcon(go/retraceme 19693c2b0a8439b7183751b64d60893829dbf56dc1e08e0669fc0cfc55754948:32) E/AndroidRuntime(13560): at com.android.wm.shell.startingsurface.SplashscreenIconDrawableFactory$ImmobileIconDrawable$$ExternalSyntheticLambda0.run(go/retraceme 19693c2b0a8439b7183751b64d60893829dbf56dc1e08e0669fc0cfc55754948:23) E/AndroidRuntime(13560): at android.os.Handler.handleCallback(Handler.java:958) E/AndroidRuntime(13560): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(13560): at android.os.Looper.loopOnce(Looper.java:205) E/AndroidRuntime(13560): at android.os.Looper.loop(Looper.java:294) E/AndroidRuntime(13560): at android.os.HandlerThread.run(HandlerThread.java:67) Syncing files to device sdk gphone64 arm64... 201ms
it is generating the icon but when i try to run it showing totally black in color. this is what my pubsec.yaml look likes:
flutter_launcher_icons: android: "launcher_icon" ios: true image_path: "assets/icon/icon.png" min_sdk_android: 21 adaptive_icon_background: "#FFFFFF

@MonkeyLautee
Copy link

Solved) If you declare adaptive_icon_background, adaptive_icon_foreground, the icons will be created as normal.

It solved my problem, thank you

This solution worked for me, THANKS A LOT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests