Masoud khanjani
Masoud khanjani

Reputation: 3

gradle sync failed when use android.support.library

I want to add android.support to project:

build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.2'
    }
}
apply plugin: 'com.android.application'

repositories {
        jcenter()
    maven{
        url "https://maven.google.com"
    }
}

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"

    defaultConfig {
        applicationId "com.example.myapplication2_gradle26_3.app"
        minSdkVersion 14
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
}

and when sync the gralde this error fired

Error:Gradle: Execution failed for task ':app:processDebugManifest'.

Error: [E:\AndroidExamples\MyApplication2-gradle26-3\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\26.0.0-alpha1\AndroidManifest.xml:21] Invalid instruction 'overrideLibrary', valid instructions are : REMOVE,REPLACE,STRICT

the project sync successfully when i add appcompat-v7:22.+ but not when want to add appcompat-v7:26.0.0-alpha1 i tried to update gradle but IDE errored 'u cant use this version' my IDE is IntelliJ 13.1.15

Upvotes: 0

Views: 326

Answers (1)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 363459

Update the Android Plugin for Gradle.

Change:

classpath 'com.android.tools.build:gradle:0.12.2'

with:

classpath 'com.android.tools.build:gradle:2.3.3'

Also there is no reason to use an alpha version of appcompat. Use the latest stable version of the support libraries:

compile 'com.android.support:appcompat-v7:26.1.0'

Upvotes: 3

Related Questions