您的位置:首页 > 其它

Gradle DSL method not found: 'runProguard()'

2016-03-10 14:12 344 查看
Error:(16, 0) Gradle DSL method not found: 'runProguard()'

Possible causes:<ul><li>The project 'Android_FAB' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).

<a href="fixGradleElements">Fix plugin version and sync project</a></li><li>The project 'Android_FAB' may be using a version of Gradle that does not contain the method.

<a href="openGradleSettings">Gradle settings</a></li><li>The build file may be missing a Gradle plugin.

<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>

报这个错的原因其实是因为你在升级完后,然后工程会默认把你的gradle版本替换成最新的版本,所以你的build.gradle文件中的dependencies也变成最新的了,如下:

dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}

新版本可能没有做到向下兼容旧版本,其实看报错:runProguard()找不着了。以前也有出现过0.12到0.14后 "useOldManifestMerger“找不到的问题,解决方法:

buildTypes {
release {

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

把代码中的 runProguard false 替换成  minifyEnabled false  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: