【发布时间】:2015-01-22 11:05:01
【问题描述】:
我最近从 Eclipse 迁移到了 Android Studio。我在 Gradle 方面遇到了一些问题。
我尝试从 github 导入这个项目:https://github.com/saulmm/Android-Material-Example,但是收到了这个错误信息:
错误:(16, 0) Gradle DSL 方法未找到:'runProguard()' 可能的原因:
项目“Android-Material-Example-master”可能正在使用不包含该方法的 Gradle 版本。 打开 Gradle 包装文件 构建文件可能缺少 Gradle 插件。 应用 Gradle 插件
这是我的 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:1.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
} }
allprojects {
repositories {
jcenter()
} }
这是我的 gradle-wrapper.properties
#Wed Apr 10 15:27:10 PDT 2013 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
我找不到他们所说的runProguard()!有什么解决办法吗?
【问题讨论】:
-
检查您的每个
build.gradle文件并将runProguard()的出现替换为minifyEnabled false -
在该 Github 项目的 app 文件夹中有一个 build.gradle 文件,其中包含
runProguard false行。将此行更改为minifyEnabled false -
你是对的,我检查了错误的 build.gradle 文件!
标签: android android-studio android-gradle-plugin