Gradle DSL method not found: 'runProguard()'
2016-04-21 19:08
381 查看
from : /article/1376580.html
本来刚升级studio到1.0的时候就想写这篇文章的,但是没空就没写了。
好吧,今天把这个问题写下,因为很多同事也遇到这个问题,解决不了,在你把Android studio升级到1.0后,你会发现你的gradle sync的时候会报底下这个错:
报这个错的原因其实是因为你在升级完后,然后工程会默认把你的gradle版本替换成最新的版本,所以你的
build.gradle文件中的dependencies也变成最新的了,如下:
dependencies {
classpath'com.android.tools.build:gradle:1.0.0-rc1'
// NOTE:Do not place your application dependencies here; they belong
// in theindividual module build.gradle files
}
那为啥变成最新的就不行了,其实这个我觉得是gradle团队可能不是那么强大的原因吧,新版本可能没有做到向下兼容旧版本...其实看报错就知道了,runProguard()找不着了。以前也有出现过0.12到0.14后"useOldManifestMerger“找不到的问题。
要让sync成功,改下gradle的版本就可以了,如下:
dependencies {
classpath'com.android.tools.build:gradle:0.14.1'
// NOTE:Do not place your application dependencies here; they belong
// in theindividual module build.gradle files
}
PS,感谢ohskean的提醒,我这边也将他提供的方法加到文章来,
old:
buildTypes {
release {
runProguard false // 已经被废弃并且停止使用了
......
}
}
new:
buildTypes {
release {
minifyEnabled false // 替代的方式
......
}
}
本来刚升级studio到1.0的时候就想写这篇文章的,但是没空就没写了。
好吧,今天把这个问题写下,因为很多同事也遇到这个问题,解决不了,在你把Android studio升级到1.0后,你会发现你的gradle sync的时候会报底下这个错:
报这个错的原因其实是因为你在升级完后,然后工程会默认把你的gradle版本替换成最新的版本,所以你的
build.gradle文件中的dependencies也变成最新的了,如下:
dependencies {
classpath'com.android.tools.build:gradle:1.0.0-rc1'
// NOTE:Do not place your application dependencies here; they belong
// in theindividual module build.gradle files
}
那为啥变成最新的就不行了,其实这个我觉得是gradle团队可能不是那么强大的原因吧,新版本可能没有做到向下兼容旧版本...其实看报错就知道了,runProguard()找不着了。以前也有出现过0.12到0.14后"useOldManifestMerger“找不到的问题。
要让sync成功,改下gradle的版本就可以了,如下:
dependencies {
classpath'com.android.tools.build:gradle:0.14.1'
// NOTE:Do not place your application dependencies here; they belong
// in theindividual module build.gradle files
}
PS,感谢ohskean的提醒,我这边也将他提供的方法加到文章来,
old:
buildTypes {
release {
runProguard false // 已经被废弃并且停止使用了
......
}
}
new:
buildTypes {
release {
minifyEnabled false // 替代的方式
......
}
}
相关文章推荐
- Android Hal层简要分析
- 阿里巴巴Java面试题
- LeetCode之24----Swap Nodes in Pairs
- go的同步模型
- shell脚本与或非
- HDU 1157 Who's in the Middle(排序取中间值)
- 使用assembly将maven项目pom.xml中的jar包打包
- z-index问题
- 十天冲刺开发第四天个人工作总结
- 严重: StandardServer.await: create[localhost:8005]
- 正式赛-ZZULIOJ-1881-蛤玮的机房(并查集)
- hadoop 学习笔记:mapreduce框架详解
- IOS中,Button的currentTitle和titleLabel.text的使用
- C#项目调用C++的DLL程序
- STM32F103RCT6 LED灯程序设计
- 说一下积性函数咯(更新中).
- Oracle 系统表
- C/C++宏定义的可变参数
- HDU 1754 线段树(单点更新)
- 数据结构-树状数组讲解