Android Studio 3.3 disallows adaptive icons for SDK version less than 26

l33t picture l33t · Jan 14, 2019 · Viewed 11.3k times · Source

Just upgraded from Android Studio 3.2.1 to 3.3. Previously my project - targeting SDK v28 - built without problems, now I get this build error:

  • What went wrong: Execution failed for task ':app:processDebugResources'.

    Android resource linking failed C:\app\src\main\res\mipmap-anydpi-v25\ic_launcher_round.xml: error: <adaptive-icon> elements require a sdk version of at least 26.
    error: failed linking file resources.

Obviously, I have an <adaptive-icon> resource in the mipmap-anydpi-v25 folder.

So, which AS version handles this correctly; 3.2.1 or 3.3? Should I remove my v25 icon? I thought Lollipop had support for this type of icons...

Answer

CommonsWare picture CommonsWare · Jan 14, 2019

which AS version handles this correctly; 3.2.1 or 3.3?

Presumably 3.3, since adaptive icons were added in Android 8.0 (API Level 26).

Should I remove my v25 icon?

Change the directory to mipmap-anydpi-v26/, and you can still use that icon for Android 8.0+. If your minSdkVersion is below that (and I assume that it is), you will need an alternative implementation of the icon for the older devices.

I thought Lollipop had support for this type of icons...

Lollipop is Android 5.x, API Level 21-22. Your -v25 directory would not be used for those API levels.