android - 错误 :The project is using an unsupported version of the Android Gradle plug-in (0. 12.2)

标签 android gradle

更新 Android Studio 后我无法运行我的应用程序 - 我收到此异常:

Error:The project is using an unsupported version of the Android Gradle plug-in (0.12.2). The recommended version is 1.0.0-rc4.

这是我的 buld.gradle 依赖项

dependencies {
    classpath 'com.android.tools.build:gradle:0.12.+'
    classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
}

更新 我在 build.gradle 中进行了更改,现在出现此错误:

Error:(42, 0) Gradle DSL method not found: 'runProguard()'
Possible causes: The project 'drivernotes-android' may be using a version of Gradle that does not contain the method.
Gradle settings The build file may be missing a Gradle plugin.
Apply Gradle plugin

更新 2 这是我的 build.gradle( fragment ):

buildscript {
repositories {
    maven { url 'http://repo1.maven.org/maven2' }
    maven { url 'http://download.crashlytics.com/maven' }
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.0.0-rc4'
    classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
}
}
apply plugin: 'android'
apply plugin: 'crashlytics'

repositories {
maven { url 'http://download.crashlytics.com/maven' }
}


android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
    minSdkVersion 9
    targetSdkVersion 19
}

packagingOptions {
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/NOTICE'
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}



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

最佳答案

使用这个版本的gradle插件

classpath 'com.android.tools.build:gradle:1.0.0-rc4'

有关 gradle 插件和 android studio 兼容性的更多信息,请参阅 this

编辑

到目前为止,android studio 和 gradle 插件都是稳定的,因此使用这个

classpath 'com.android.tools.build:gradle:1.0.0'

关于android - 错误 :The project is using an unsupported version of the Android Gradle plug-in (0. 12.2),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27353974/

相关文章:

java - 检查自定义对象ArrayList的属性是否为空字符串?

android - 需要有关 Google Map API 自动完成教程的帮助

android - 无法在模拟器上运行 Google Play 服务(需要更新 Google Play 服务)

android - 如何确定 Gradle 的版本?

Android Studio 测试失败 junit.framework.AssertionFailedError

java - 无法使用 javac 和 lombok 在控制台中编译 .h 文件。错误 : package lombok does not exist

android - 自定义 Gradle 任务以将解析后的 Json 保存到文件中。安卓

android - 从后台恢复 Android 应用程序后,它卡住了

android - 如何在每个 Activity 中添加 DrawerLayout?

java - 在android项目中添加外部依赖jar