App Icon Launcher not showing in Android 7.1.1

2019-07-04 06:20发布

We are implementing a round icon (with a foreground and a background) and icon.

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

Works for every version but not for API 25

enter image description here

Our code for Foreground with Background is the next one

<?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>

3条回答
\"骚年 ilove
2楼-- · 2019-07-04 06:37

Resource structure:

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"

Add resource redirection for the roundIcon resource so that you are guaranteed to have the v26 adaptive icon on API level 26+:

values-anydpi-v26
   \  drawables.xml

drawables.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <mipmap name="ic_launcher_round">@mipmap/ic_launcher</mipmap>
</resources>
查看更多
再贱就再见
3楼-- · 2019-07-04 06:40

In my case it was caused by deleting PNG/bitmap versions of round icons.

I kept only the mipmap-anydpi-v26 XML versions of the round icon. And deleted all the round icons in folders such as mipmap-hdpi, mipmap-mdpi, etc. thinking they are useless.

When round versions of PNG bitmaps are deleted it works fine on all Android versions (> 4.0) except Android 7.1 API level 25.

查看更多
ら.Afraid
4楼-- · 2019-07-04 06:40

You add other icons:

enter image description here

In manifest:

<application
    android:name=".MiseApplication"
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"`
查看更多
登录 后发表回答