'This folder configuration ('v26') is unnecessary; 'minSdkVersion' is 26. Merge all the resources in this folder into 'mipmap-anydpi'

I'm getting this message in the Code Analysis after setting my Min SDK to 26.

This folder configuration ('v26') is unnecessary; 'minSdkVersion' is 26. Merge all the resources in this folder into 'mipmap-anydpi'.

However, I don't know exactly what to do with this?

I have tried to reformat the existing folder into 'mipmap-anydpi' and then it gives me 20 error messages saying the icon is defined as both Bitmap and XML in every mipmap folder (hdpi, xhdpi etc.

There's also a button I can click to let Android studio handle it. The button says "Merge resources from -anydpi-v26 into mipmap-anydpi". However, when I click it, it just creates an empty XML file at the bottom. And that file complains that it doesn't have a root tag (no wonder, because it's empty). I also can't transfer the XML tags from the 26 folder into this folder because then I get another error message saying I have multiple roots, or that it can't find the XML schema.

How am I supposed to address this?



Solution 1:[1]

I have tried to reformat the existing folder into 'mipmap-anydpi' and then it gives me 20 error messages saying the icon is defined as both Bitmap and XML in every mipmap folder (hdpi, xhdpi etc.

You also need to remove all the ic_launcher.png files from your mipmap-mdpi/mipmap-hdpi etc. Then Android v26 and beyond would take the only launcher icon you have in mipmap-anydpi.

Also, as referenced in the comments to this SO answer you can even name that folder as just mipmap.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Andrew Panasiuk