在android studio中显示错误修复插件版本和同步项目

时间:2016-05-20 06:03:05

标签: android-studio android-gradle build.gradle

我是Android Studio的新人,当我突然创建一个新项目时,我收到了一条错误消息,Error:(1, 0) Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to "9ba5989c7b283b0ec145cc20641f7155619d6148"

这是我的build.gradle文件

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "************"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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

我的build.gradle(项目)

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.0.0-alpha2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我已经更新了我的Android工作室2.0,但在打开创建项目时总是显示Fix plugin version and sync project。请任何人都能告诉我应该怎么做才能解决这个问题。 提前谢谢......

1 个答案:

答案 0 :(得分:0)

classpath 'com.android.tools.build:gradle:2.2.+'而非使用

@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)这为我修复了同样的错误!