Wednesday, December 31, 2014

How To Solve The Gradle DSL method not found: 'runProguard()' Error In Android Studio

After upgrading Android Studio, I ran into the following error -

Gradle DSL method not found: 'runProguard()'

This issue prevented the project from building. The solution was simple.
Do a search and replace.

Press Ctrl-F or Edit/Find and enter the letters runProguard into the search area.
Once you have found runProguard, you will see that it is listed in this procedure:

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

Change the area I have highlighted to the following:

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

That is it! That will solve the issue for you.
Wasn't that simple?
Here is a link to more information about why this is necessary.

http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0
Enjoy!

Smooches!
Kila


No comments: