mohamad.zamani
mohamad.zamani

Reputation: 105

Gradle error when sync project in Android Studio 3

any time that i create project in android studio 3 i have problem with gradle sync with errors.

enter image description here Message Gradle Build:

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]
/Applications/Desktop/AndroidProjects/RealmProject/app/build/intermediates/manifests/full/debug/AndroidManifest.xml
Error:(11) error: attribute 'android:roundIcon' not found.
Error:(11) attribute 'android:roundIcon' not found.
Error:failed processing manifest.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt
Information:BUILD FAILED in 23s
Information:7 errors
Information:0 warnings
Information:See complete output in console

app.gradle module config:

android {
    compileSdkVersion 24
    defaultConfig {
        applicationId "com.example.mohammad.realmproject"
        minSdkVersion 17
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation 'com.android.support:appcompat-v7:24.0.0'
        testImplementation 'junit:junit:4.12'
    }

Upvotes: 2

Views: 2909

Answers (1)

Nawrez
Nawrez

Reputation: 3332

related to this answer => roundIcon is an attribute that was first introduced for Android O (8.0, 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 O, 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.

Upvotes: 3

Related Questions