Android icon generator for actionbar and notification not working (grey shape)-ThrowExceptions

Exception or error:

I found this Asset Studio to generate icons. It works fine for the launcher icon but for action bar or notification icons it is not working. I put in my png file and want to generate the icons, but Asset Studio is only generating gray circles. Is there another tool to generate action bar and notification icons?

enter image description here

How to solve:

You can use a tool for creating generic icons in Asset Studio: https://romannurik.github.io/AndroidAssetStudio/icons-generic.html.
To get it look like ActionBar Icon, you should make next actions:

  1. Choose image
  2. The size of image should stay at 24dip
  3. Change padding to 4dip
  4. Move foreground color thumb to 0%
  5. That’s it! Download .zip now.

The sizes of icons will be pretty the same as you can get them with ActionBar Icon Generator.

How it looks for me:
icon generator screenshot

###

I think it’s because your image is too complexe and the main problem is the “color” filter applied in AAS.

I had the same problem and I had to convert xxxhdpi xxhdpi etc. manually. If you work with Sketch (for example) it can be converted easily with a plugin (https://github.com/zmalltalker/sketch-android-assets)

hope it’s help !

If you want to use AAR, like @rom4ek explained “4. Move foreground color thumb to 0%” this is the important part

###

I use an own module ‘icons’ with a Gradle script to generate icons. This is a more automated way than the Assets Studio can provide up-to-now. The icon will be designed with Inkscape. See my blog for a detailed description. You find an Android Studio Project on GitHub.

###

after alot of search this is the solution:
the problem is you are adding an image with white background..
to convert the image to actionbar icon you have to load image with transparent background

###

You can use the built in feature of android studio to generate actionbar and notification icons.

Right click on res folder and New > Image Asset. You can choose Launcher Icons, Action Bar Icons or Notification Icons in the Asset Type.

Update:
You should look at this. It talks about white icon in notification.

###

I face the same problem their is no issue with icon after Lollipop notification icon do not contains color icon it support flat,Silhouette icon supported.

  • Either you can change target SDK to 20
  • Or generate flat icon(icons8 is best option)

Or

you should use a condition

  boolean useWhiteIcon = (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP);
    return useWhiteIcon ? R.drawable.icon_silhouette : R.drawable.ic_launcher;

###

Android Studios 2.2 has an Image Asset Studio that you can use to generate your icons.

https://developer.android.com/studio/write/image-asset-studio.html

###

By default it will be grey color for any image. But you can customize it according to your color. Check below screenshot to select CUSTOM tab and then select color you want.

enter image description here

Hope it helps you.

Leave a Reply

Your email address will not be published. Required fields are marked *