Android: Solve the Problem of Gradle DSL method not found: & amp; #39; runProguard () & amp; #39;

Source: Internet
Author: User

Android: Solve the Problem of Gradle DSL method not found: & #39; runProguard () & #39;

After Android Studio is upgraded to the latest version (1.0 RC 4), the following problems occur when running the project:

Gradle DSL method not found: 'runproguard ()'

The reason for this problem is that the runProguard () method cannot be found (the method is called in the build. gradle file corresponding to each Module ).

This is because when Android Studio is upgraded, the build. gradle file under the project is automatically uploaded (not the build. gradle file corresponding to the Module !) The following content is modified:

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    }
This is the case before the upgrade (taking my computer as an example, it 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, which may be effective.

However, this is obviously not the best method. After reading the official documentation (http://tools.android.com/tech-docs/new-build-system) found that in the new version of gradle, runProguard this method has been abandoned, and changed to the new method:minifyEnabled. Therefore, the correct solution is not to modify the version number of gradle, but to change the runProguard method name in the build. gradle file corresponding to each Module in the projectMinifyEnabled, that is:

buildTypes {        release {            minifyEnabled false            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'        }    }

The problem is solved perfectly.

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.