33

I'm trying to compile my Project,but in there is some error

Android manifest.xml

 <application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

I already try to rebuild project or sync with gradle but it's not working for me.

my dependencies

compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile project(':circleimageview-2.0.0-sources')

How to fix this error? I'm newbie to Android Studio.

AndriiSG
  • 365
  • 1
  • 3
  • 13
  • 4
    `roundIcon` was [first added in API 25](https://developer.android.com/reference/android/R.attr.html#roundIcon), so my guess is that your project is configured to build for an earlier API. Could you post your project-level `build.gradle`? – Michael Dodd Mar 27 '17 at 14:57
  • 1
    Simply remove `android:roundIcon="@mipmap/ic_launcher"` – Phantômaxx Mar 27 '17 at 14:59

4 Answers4

58

roundIcon is an attribute that was first introduced for Android Nougat 7.1 (API level 25), therefore you have two available options based on the type of device you're targeting:

  • If you're building an app specifically for Android 7.1 or above, ensure that minSdkVersion and targetSdkVersion are set to 25 in your app's build.gradle:

defaultConfig {
    minSdkVersion 25
    targetSdkVersion 25
}

  • Alternatively, if you want to target older API levels, you will need to remove android:roundIcon from your manifest and only use android:icon.
Michael Dodd
  • 10,102
  • 12
  • 51
  • 64
7

I removed android:roundIcon from my manifest, but when compiling my project with API 24, the android:roundIcon property is still added to the AndroidManifest.xml.

In order to resolve my problem, I had to update my API to version 25 and set comileSdkversion to 25.

andrewgu
  • 1,562
  • 14
  • 23
harley hu
  • 81
  • 1
  • 4
  • That's probably because you removed it from the AndroidManifest.xml generated in the target. That the one that will open when you click on the error. You should remove it from the source code (The one you wrote). – Anthony Aug 04 '18 at 22:30
0

roundIcon is an attribute that was first introduced for Android O (8.0). So you have to change the app compile SDK version.

change the compile SDK version

Muhamed Riyas M
  • 5,055
  • 3
  • 30
  • 31
0

As already answered earlier, roundicon was first introduced in API Level 25. If you want to maintain a lower API level without increasing to >= 25 then

go to the mipmap directory and delete the subdirectory "ic_roundicon" with all its files

delete @res/mipmap/ic_roundicon