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
Is this just an Android Studio bug or did I miss something?
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.
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With