Android 7.1.1中未显示应用程序图标启动器

Android 7.1.1中未显示应用程序图标启动器,android,android-7.1-nougat,Android,Android 7.1 Nougat,我们正在实现一个圆形图标(有前景和背景)和一个图标 <application android:allowBackup="false" tools:replace="android:allowBackup" android:label="@string/app_name" android:supportsRtl="true" android:icon="@mipmap/logo" //normal logo android:roundIcon=

我们正在实现一个圆形图标(有前景和背景)和一个图标

<application
    android:allowBackup="false"
    tools:replace="android:allowBackup"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:icon="@mipmap/logo" //normal logo
    android:roundIcon="@mipmap/logo_o" //Our logo with foreground and background
    android:name=".MyApplication"/>

我们的前台和后台代码是下一个

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@mipmap/logo_background"/>
    <foreground android:drawable="@mipmap/logo_foreground"/>
</adaptive-icon>

在我的例子中,这是因为删除了圆形图标的PNG/位图版本

我只保留了圆形图标的
mipmap-anydpi-v26
XML版本。并删除了文件夹中的所有圆形图标,如
mipmap hdpi
mipmap mdpi
,认为它们没有用

删除PNG位图的圆形版本后,除Android 7.1 API级别25外,它在所有Android版本(>4.0)上都能正常工作。

资源结构:

mipmap-anydpi-v25
   \  ic_launcher_round.xml
mipmap-anydpi-v26
   \  ic_launcher.xml
mipmap-*dpi
   \  ic_launcher.png
AndroidManifest.xml:

<application android:icon="@mipmap/ic_launcher"
             android:roundIcon="@mipmap/ic_launcher_round"
drawables.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <mipmap name="ic_launcher_round">@mipmap/ic_launcher</mipmap>
</resources>

@mipmap/ic_启动器
您可以添加其他图标:

在舱单中:

<application
    android:name=".MiseApplication"
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"`

您应该在Android studio中使用图像资源重新生成

对于API 25,您应该生成圆形图标

您是通过在mipmap资源文件中添加图像来设置图标还是使用图像资源来设置图标的,您使用了哪一个?我有同样的问题,您解决了吗?@OlivierMercier我也有同样的问题,刚刚解决了
<application
    android:name=".MiseApplication"
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"`