12
votes

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

5
Minimum supported API has nothing with minimum version of SDK. Just increase compile version of used SDK and invalidate cache.Arthur
targetSdkVersion 28 in my gradle file. Also updated the v28 SDK to revision 6. Still same problem...l33t
I'm talking not about target sdk but about compile sdkArthur
Well, I actually set compileSdkVersion 28 as well.l33t
Same here, compile and target were both set at 27 for meericjam

5 Answers

7
votes

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.

4
votes

For me, in AS 3.4, I had to:

Android Studio: File | Project Structure

enter image description here

It did not work for me to be able use add New | Image Asset due to the Adaptive Icons UNTIL I did that final step of remove SDK 25 from the list even after trying to correctly select the Project SDK and the Build Target.

I had tried several things and this was the final step that made it work for me. I don't know if this is particular to something in my configuration, but this got me past it.

1
votes

I had the same problem, the reason was I messed up with the files manually but I didn't notice it until the update. In my case, after update to AS 3.3, the files in conflict were:

  • drawable/ic_launcher_background.xml
  • drawable-v24/ic_launcher_foreground.xml

Although AS builds with without errors by changeing the min sdk "minSdkVersion 26" on app/build.gradle, it isn't practical for publishing purposes. the easy quick solution was:

  • create a blank new project
  • copy the exact same files
  • and replace them in the conflicted project
0
votes

It shows an error when you have APIs less than 26 in SDK.

To remove Older APIs from SDK:

  1. Click on File.
  2. Select Project Structure.
  3. Select SDKs inside Platform Setting.
  4. In right side check if is there any older APIs showing then API 26.
  5. Select Older APIs and click on Delete (-) Button.

Remove all older APIs than API 26. Click on Apply and ok.

It will work :)

0
votes

Here is how i fixed it.

  1. File -> Project Structure
  2. Select Modules
  3. Change compile SDK to above API 26 (optional i think)
  4. Select tab Default Config and change target SDK version to above API 26