【发布时间】:2014-09-07 19:48:31
【问题描述】:
这是我第一次尝试 Android Studio。我安装了 0.8.0 并更新到 0.8.2。一旦创建项目,我就会收到错误消息:
错误:(1, 0) 未找到 ID 为“com.android.application”的插件
C:\Users\Bob\AndroidStudioProjects\HelloAgain6\app\build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.bob.helloagain6"
minSdkVersion 15
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
和 C:\Users\Bob\AndroidStudioProjects\HelloAgain6\build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
【问题讨论】:
-
我遇到了这个问题,但突然我看到顶层
build.gradle被删除了:),所以我从git存储库中复制它,一切正常 -
对我来说也是一样,我的项目级别的 build.gradle 在时髦的合并过程中被移动到与包装器属性相同的文件夹中,因此它没有在它应该在的根目录中找到它跨度>
标签: android gradle android-gradle-plugin