Error:(1, 0) plugin: 'com.android.application&

2019-04-10 13:40发布

问题:

This question already has an answer here:

  • Error:(1, 0) Plugin with id 'com.android.application' not found 19 answers

I got this error when I was creating new project. I tried to resolve but I couldn't find any solution.

回答1:

First: Add the following code to the top of your build.gradle:

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

allprojects {
    repositories {
        jcenter()
    }
}

Second: Find the gradle-wrapper.properties. Change the last sentence to this:

distributionUrl=http\://services.gradle.org/distributions/gradle-2.2.1-all.zip

Hope this works for you.