Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Legacy icon does not show when using adaptive icon

I just converted my app icon to be compatible with android o's adaptive icons using the Image Asset Studio in android studio

when I run my project now on my device running API 25 I get the default green android icon and not my icon.

this is my manifest

<application     android:icon="@mipmap/ic_launcher"     android:label="@string/app_name"     android:theme="@style/AppTheme"     android:allowBackup="false"     android:roundIcon="@mipmap/ic_launcher_round"     tools:replace="allowBackup"     tools:ignore="GoogleAppIndexingWarning"> 

and these are the files the image asset studio created

enter image description here

Is this just an Android Studio bug or did I miss something?

like image 725
tyczj Avatar asked Jun 08 '17 20:06

tyczj


People also ask

How do I use adaptive icon on Android?

Add your adaptive icon to your app xml , create alternative drawable resources in your app for backward-compatibility with Android 8.0 (API level 26). You can then use the <adaptive-icon> element to define the foreground, background, and monochromatic layer drawables for your icons.

Is Android roundIcon required?

You must only use the android:roundIcon attribute if you require a different icon asset for circular masks, if for example the branding of your logo relies on a circular shape.


1 Answers

I had the same trouble, and solved it by renaming my mipmap-anydpi directory to mipmap-anydpi-v26.

Apparently the ic_launcher.xml file confuses older Android versions, and this hides it from all but O. At any rate, my icons now work on all versions (down to SDK 11, at least).

like image 185
Sterling Avatar answered Sep 21 '22 17:09

Sterling