Problem with anydpi-v26 when creating launcher icon in Image Asset Studio

6.4k views Asked by At

When creating an launcher icon (Adaptive and Legacy) in a Image Asset Studio with a Clip Art, images are created in the mipmap folder:

enter image description here

But for anydpi-v26, the standard icon for the foreground does not change, although the background color has changed:

enter image description here

ic_launcher.xml(anydpi-v26):

<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"/>
</adaptive-icon>

there are two files in the ic_launcher_foreground folder: ic_launcher_foregraund.xml (new icon) and ic_launcher_foregraund.xml (v24) (standard icon)

Why doesn't he change to a new drawing automatically? Thanks for any answer!

4

There are 4 answers

1
fab2vo On BEST ANSWER

I had the same issue. Same solution. For some reason, the old file ic_launcher_foreground.xml is not deleted in the drawable folder when creating the new launcher icon. You end up with two files having the same name. So deleting it (without safe delete), solves the problem.

2
alexrnov On

I removed the ic_launcher_foreground.xml(v24) file from folder: res/drawable/ic_launcher_foreground/, which remained from the standard icon.

This action solved the problem:

enter image description here

0
aaronmarino On

I encountered this issue because one of my libraries had a launcher icon defined. Bizarrely the app module read the ic_launcher_background from the app module, but the ic_launcher_foreground from the library module.

0
tinmarfrutos On

@aaronmarino's answer is right. The only solution i found to use ic_launcher_foreground from app module is to rename it to ic_launcher_foreground_something.xml

<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_launcher_background_something"/>
    <foreground android:drawable="@drawable/ic_launcher_foreground_something"/>
</adaptive-icon>