Gradle sync failed: 'com.android.build.gradle.BasePlugin' does not implement the Plugin interface

后端 未结 1 873
无人及你
无人及你 2020-12-24 14:32

Environment : Android Studio 2.1

Project : Android SDK + Cordova

Android Studio throws the following error during Gradle Sync :

Gradle sync failed:

相关标签:
1条回答
  • 2020-12-24 15:29

    Faced the same issue after upgrading to android studio 2.1 from 1.5

    Managed to resolve by updating the dependencies version if the gradle.gradleVersion >= 2.1 in the build.gradle file under buildscript {}

    OLD Configuration

     if (gradle.gradleVersion >= "2.2") {
        dependencies {
            classpath 'com.android.tools.build:gradle:1.5.0'
        }
    } else if (gradle.gradleVersion >= "2.1") {
        dependencies {
            classpath 'com.android.tools.build:gradle:0.14.0+'
        }
    } else {
        dependencies {
            classpath 'com.android.tools.build:gradle:0.12.0+'
        }
    }
    

    Updated Configuration

    if (gradle.gradleVersion >= "2.2") {
        dependencies {
            classpath 'com.android.tools.build:gradle:1.5.0'
        }
    } else if (gradle.gradleVersion >= "2.1") {
        dependencies {
            classpath 'com.android.tools.build:gradle:2.1.0'
        }
    } else {
        dependencies {
            classpath 'com.android.tools.build:gradle:0.12.0+'
        }
    }
    

    If you do not have if/else clause in your build.gradle you can update the dependencies directly as below,

    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
    }
    
    0 讨论(0)
提交回复
热议问题