Anroid studio遇到的问题4---Gradle DSL method not found runProguard
2016-08-23 10:15
489 查看
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
相关文章推荐
- 4. Gradle DSL method not found runProguard
- Gradle DSL method not found: 'runProguard()'
- 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()' 问题
- 关于studio升级到1.0.0-rc4后出现的 “Gradle DSL method not found: 'runProguard()'...”的问题解决方法
- Gradle DSL method not found: 'runProguard()' 问题的引发与解决
- Gradle DSL method not found: 'runProguard()'问题的解决办法
- AndroidStudio:解决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()'
- AndroidStudio升级至1.0提示Gradle DSL method not found: 'runProguard()'
- Gradle DSL method not found: 'runProguard()'
- Android studio 升级1.0后导入之前的Android studio项目,编译不成功,提示Gradle DSL method not found: 'runProguard()'
- 打开android项目报错 Gradle DSL method not found: 'android()'和Gradle DSL method not found: 'runProguard‘
- Gradle DSL method not found: 'android()' /runProguard()’