gradle 使用 android.support.library 时同步失败

gradle sync failed when use android.support.library

我想将 android.support 添加到项目中:

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'
}

并且在同步 gralde 时引发此错误

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

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

当我添加 appcompat-v7:22.+ 时项目同步成功,但当我想添加 appcompat-v7:26.0.0-alpha1 时却没有 我尝试更新 gradle 但 IDE 出错 'u cant use this version' 我的 IDE 是 IntelliJ 13.1.15

更新 Gradle 的 Android 插件。

变化:

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

与:

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

也没有理由使用 appcompat 的 alpha 版本。使用支持库的最新稳定版本:

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