Plugin with id com.android.application not found

我这个项目是从github上面下载的,Import Project时出现了application错误,经过查找,我在这里找到了解决办法

http://stackoverflow.com/questions/24795079/error1-0-plugin-with-id-com-android-application-not-found

就是在build.gradle最上面加上

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
    }
}
加完之后效果如下,这样就好了

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
    }
}
apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "21.0.0"
    android {compileOptions.encoding = "UTF-8"}
    defaultConfig {
        applicationId "com.cheng.contact"
        minSdkVersion 15
        targetSdkVersion 19
        versionCode 2
        versionName "1.1"
    }

一定要记得,可以回车,不能有空格

你可能感兴趣的:(安卓开发异常处理,git使用)