修复Android Studio中的插件版本和同步项目错误

修复Android Studio中的插件版本和同步项目错误,android,android-studio,Android,Android Studio,我目前正在打开这个文件Android Studio 2.1,该应用程序是在Android Studio 1.5版中创建的 Error:(1, 0) Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to "abf87974ef3c08e3258fe37c7d5001161385f549" Fix plugin version a

我目前正在打开这个文件Android Studio 2.1,该应用程序是在Android Studio 1.5版中创建的

Error:(1, 0) Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to "abf87974ef3c08e3258fe37c7d5001161385f549"
Fix plugin version and sync project
Open File
导入Android项目时出现问题,显示错误。
按“修复插件”后,显示“更新失败”

这是我的
build.gradle
文件

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "app.asharbhutta.com.challanlogin"
        minSdkVersion 13
        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'
    classpath 'com.android.tools.build:gradle:2.1.4'
}
这是gradle-wrapper.properties

#Wed Oct 21 11:34:03 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip

我在中找不到
'com.android.tools.build:gradle:2.1.4'

因此,这个错误是有道理的

修复插件版本和同步项目

截至本帖,最新的稳定版本是
2.1.2

注意:Gradle完全独立于Android插件。
gradle-2.14-bin的版本并不总是与插件号匹配


这应该是不言自明的,但为了澄清,这是正确的
build.gradle

项目
/build.gradle
app/build.gradle
内建.gradel 在依赖项中,类路径以+号结尾,如图所示


classpath'com.android.tools.build:gradle:2.2.0+

你的gradle插件太旧了?请显示
build.gradle
文件。是的,我知道,请告诉我如何修复它。@cricket\u 007现在你可以看到我的gradle文件了。。谢谢!现在,应该有两个。。。一个在项目根目录中,另一个在
app/
目录中。如果不是这样,那么你是如何生成这个项目的?我已经提到我已经导入了这个应用程序。你能告诉我如何读取代码吗。。。因为我需要此项目代码..
com.android.tools.build:gradle:2.1.4
--将此
2.1.4
更改为可以从Bintray中找到的数值单击我答案中的“Bintray”链接。Bintray是一个网站。不是Android Studio的一部分。比,,。。?我能看到你告诉我的号码吗?@MusaJutt很抱歉你有困难,但我不知道如何解释。
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'

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

allprojects {
    repositories {
        jcenter()
        mavenCentral()
    }
}
apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "app.asharbhutta.com.challanlogin"
        minSdkVersion 13
        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'
    // classpath 'com.android.tools.build:gradle:2.1.4' // This shouldn't be here
}