Anroid studio遇到的问题4---Gradle DSL method not found runProguard
来源:互联网 发布:中国电视剧 国外 知乎 编辑:程序博客网 时间:2024/06/05 06:41
4. Gradle DSL method not found runProguard
今天下载了新版本的Android Studio,导入以前做的demo时,出现了这样的错误。<code class="hljs oxygene has-numbering">Error:(<span class="hljs-number">16</span>, <span class="hljs-number">0</span>) Gradle DSL <span class="hljs-function"><span class="hljs-keyword">method</span> <span class="hljs-title">not</span> <span class="hljs-title">found</span>:</span> <span class="hljs-string">'runProguard()'</span>Possible causes:<ul><li>The project <span class="hljs-string">'Mobile'</span> may be <span class="hljs-keyword">using</span> a version <span class="hljs-keyword">of</span> Gradle that does <span class="hljs-keyword">not</span> contain the <span class="hljs-function"><span class="hljs-keyword">method</span>.<<span class="hljs-title">a</span> <span class="hljs-title">href</span>="<span class="hljs-title">open</span>.<span class="hljs-title">wrapper</span>.<span class="hljs-title">file</span>"><span class="hljs-title">Open</span> <span class="hljs-title">Gradle</span> <span class="hljs-title">wrapper</span> <span class="hljs-title">file</span></<span class="hljs-title">a</span>></<span class="hljs-title">li</span>><<span class="hljs-title">li</span>><span class="hljs-title">The</span> <span class="hljs-title">build</span> <span class="hljs-title">file</span> <span class="hljs-title">may</span> <span class="hljs-title">be</span> <span class="hljs-title">missing</span> <span class="hljs-title">a</span> <span class="hljs-title">Gradle</span> <span class="hljs-title">plugin</span>.<<span class="hljs-title">a</span> <span class="hljs-title">href</span>="<span class="hljs-title">apply</span>.<span class="hljs-title">gradle</span>.<span class="hljs-title">plugin</span>"><span class="hljs-title">Apply</span> <span class="hljs-title">Gradle</span> <span class="hljs-title">plugin</span></<span class="hljs-title">a</span>></<span class="hljs-title">li</span>></span></code><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li></ul>
解决办法:
如果你在使用高于 0.14.0版本的 Gradle插件,那你需要将“runProguard”替换成“minifyEnabled”
以前的:
<code class="hljs bash has-numbering"> buildTypes { release { runProguard <span class="hljs-literal">false</span> proguardFiles getDefaultProguardFile(<span class="hljs-string">'proguard-android.txt'</span>), <span class="hljs-string">'proguard-rules.pro'</span> } }</code><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li></ul>
改正后:
<code class="hljs bash has-numbering"> buildTypes { release { minifyEnabled <span class="hljs-literal">false</span> proguardFiles getDefaultProguardFile(<span class="hljs-string">'proguard-android.txt'</span>), <span class="hljs-string">'proguard-rules.pro'</span> } }</code><ul style="" class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li></ul>
因为在0.14.0版本已将runProguard改名为minifyEnabled 。
详情可见http://tools.android.com/tech-docs/new-build-system
0 0
- Anroid studio遇到的问题4---Gradle DSL method not found runProguard
- AndroidStudio:解决Gradle DSL method not found: 'runProguard()' 的问题
- Gradle DSL method not found: 'runProguard()'问题的解决办法
- Android studio: Gradle DSL method found: 'android()'!及Gradle DSL method not found: 'runProguard()'错误
- Android:解决Gradle DSL method not found: 'runProguard()' 问题
- Android:解决Gradle DSL method not found: 'runProguard()' 问题
- Android:解决Gradle DSL method not found: 'runProguard()' 问题
- Android:解决Gradle DSL method not found: 'runProguard()' 问题
- Android:解决Gradle DSL method not found: 'runProguard()' 问题
- Gradle DSL method not found: 'runProguard()'
- Gradle DSL method not found: 'runProguard'解决办法
- Gradle DSL method not found: 'runProguard()'
- Gradle DSL method not found: 'runProguard()'
- Gradle DSL method not found: 'runProguard'
- Gradle DSL method not found: 'runProguard()'
- Gradle DSL method not found: 'runProguard()'
- Gradle DSL method not found: 'runProguard()'
- Gradle DSL method not found: 'runProguard()'
- 工具类--本地路径图片转字节
- Base64算法 编码过程和原理
- Magento调用New Arrivals 新品上架产品实例
- lucene 多路归并算法
- JSON.parse()和JSON.stringify()使用介绍
- Anroid studio遇到的问题4---Gradle DSL method not found runProguard
- jqGrid初始化自带选中
- Joda 日期类简单的获取当前完整日期和当前日子的用法
- [CSS3] 新增属性用法整理
- 第三章 数据和C(二)
- 什么是防火墙的入站规则和出站规则.如何新建入站规则
- spring aop 利用JoinPoint获取参数的值和方法名称
- tomcat启动很慢的问题
- (转载)Shell脚本中$0、$?、$!等的意义