Android: Fix Gradle DSL method not found: ' Runproguard () ' Problem

Source: Internet
Author: User

After upgrading Android studio to the latest version (1.0 RC 4), there was a problem running the project:

Gradle DSL method not found: ' Runproguard () '

Literally, the reason for this problem is that Runproguard () is not found (this method is called in the corresponding Build.gradle file for each module).

This is because when Android Studio is upgraded, it also automatically build.gradle files under the project (not the module corresponding to the build.gradle! ) changes to the following:

dependencies {        classpath ' COM.ANDROID.TOOLS.BUILD:GRADLE:1.0.0-RC4 '        //Note:do not place your application dependencies here; They belong        //In the individual module Build.gradle files    }
And before the upgrade is like this (take my computer as an example, should be similar):

dependencies {        classpath ' com.android.tools.build:gradle:0.12.2 '        //Note:do not place your application dependencies here; They belong        //In the individual module Build.gradle files    }

Obviously, the simplest solution is to change the Gradle version back, and this method may indeed work.

However, this is clearly not the best approach. After reviewing the official documentation (HTTP://TOOLS.ANDROID.COM/TECH-DOCS/NEW-BUILD-SYSTEM), it was found that in the new version of Gradle, the Runproguard method was deprecated and changed to a new method: minifyEnabled. Therefore, the correct workaround is not to modify the version number of the Gradle, but instead to change the Runproguard method name in the Build.gradle file for each module in the project tominifyEnabled,即:

Buildtypes {        Release {            minifyenabled false            proguardfiles getdefaultproguardfile (' Proguard-android.txt ') ), ' Proguard-rules.pro '        }    }

Problem solved perfectly.

Android: Fix Gradle DSL method not found: ' Runproguard () ' Problem

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.