Plugin with id 'android' not found (Android Studio)

六月ゝ 毕业季﹏ 提交于 2019-12-23 16:26:14

问题


I recently just switched to Android Studio 0.6.1 for app dev and I ran into an issue with gradle.

I get "Error:(1, 0) Plugin with id 'android' not found. I am quite new so any help would be appreciated.

Here is my build.gradle file:

apply plugin: 'android'

android {

    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "com.b3dog.helloagain"
        minSdkVersion 15
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {

    compile fileTree(dir: 'libs', include: ['*.jar'])
}

回答1:


this issue appears in my android studio 0.6.1 canary build so after a week struggling i found whats wrong with new studio version . its not about Gradle as far as i see . and it happen to some people and you know why ? because some people specially junior developer accidentally proceeding in way that this error occur just after create new project . problem came from name of your activity let me explain it to your step by step

now , when u create new project , wizard appear and here's your step :

first : you enter application name second : select your minimum sdk third : type of your activity forth : your activity name

here's the point . if you choose the system default"my activity

error will occur but if you change it to your own custom name such as "myListactivity" or any other custom One . this error will no longer exist .




回答2:


Mostly it is because of that project sync error.

In android studio, please try that click "tools" ->"Android"-> "sync project with gradles files."



来源:https://stackoverflow.com/questions/24421430/plugin-with-id-android-not-found-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!