android 编译错误 Error:(1, 0) Plugin with id 'com.android.application' not found.

在导入一个项目时,由于它本身的gradle版本比较高,你试用比较旧版本的gradle时就报出Plugin with id 'com.android.application' not found.的错误

如果出现如上错误,只需要在build.gradle中添加下面代码即可:

 (直接加在 android{ } 的外面)

buildscript {
    repositories {
        jcenter() // or mavenCentral()
}

    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
}
}

allprojects {
    repositories {
        jcenter()
    }
}

参考:http://blog.csdn.net/zhengdan66/article/details/50418747#comments


原文地址:https://www.cnblogs.com/Sharley/p/7049357.html