在 Image Asset Studio 中创建启动器图标时出现 anydpi-v26 问题

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

在带有剪贴画的 Image Asset Studio 中创建启动器图标(自适应和旧版)时,将在 mipmap 文件夹中创建图像:

但是对于anydpi-v26,前景的标准图标没有改变,尽管背景颜色已经改变:

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>

ic_launcher_foreground文件夹中有两个文件:ic_launcher_foregraund.xml(新图标)和ic_launcher_foregraund.xml(v24)(标准图标)

他为什么不自动换成新图呢?感谢您的回答!

我从文件夹 res/drawable/ic_launcher_foreground/ 中删除了 ic_launcher_foreground.xml(v24) 文件,该文件保留在标准图标中。

此操作解决了问题:

我遇到了同样的问题。相同的解决方案。由于某些原因,在创建新的启动器图标时,drawable 文件夹中的旧文件 ic_launcher_foreground.xml 没有被删除。您最终得到两个具有相同名称的文件。所以删除它(without safe delete),解决了问题。

我遇到这个问题是因为我的一个库定义了启动器图标。奇怪的是,app 模块从 app 模块读取 ic_launcher_background,但从 library 模块读取 ic_launcher_foreground。