Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After Android Studio update: Gradle DSL method not found: 'runProguard()'

I've just updated my Android Studio and now my project won't build anymore. I get following error:

Error:(16, 0) Gradle DSL method not found: 'runProguard()' Possible causes:<ul><li>The project 'App' may be using a version of Gradle that does not contain the  method. <a href="openGradleSettings">Gradle settings</a></li><li>The build file may be missing a Gradle plugin. <a href="apply.gradle.plugin">Apply Gradle plugin</a></li> 

I didn't change anything, everything worked properly before the update. Here's my build.gradle file:

apply plugin: 'com.android.application'  android {     compileSdkVersion 21     buildToolsVersion "20.0.0"      defaultConfig {         applicationId "com.ochs.pipette"         minSdkVersion 10         targetSdkVersion 21         versionCode 8         versionName "1.6"     }     buildTypes {         release {             runProguard false             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'         }     } }  dependencies {     compile fileTree(include: ['*.jar'], dir: 'libs')     compile 'com.android.support:appcompat-v7:21.0.0'     compile 'it.sephiroth.android.library.imagezoom:library:1.0.4'     compile 'com.android.support:palette-v7:21.0.+' } 

And here's the other one:

// Top-level build file where you can add configuration options common to all sub-projects/modules.  buildscript {     repositories {         jcenter()     }     dependencies {         classpath 'com.android.tools.build:gradle:1.0.0-rc2'          // NOTE: Do not place your application dependencies here; they belong         // in the individual module build.gradle files     } }  allprojects {     repositories {         jcenter()     } } 

I don't know how to fix the problem, could anyone help me?

like image 226
user2410644 Avatar asked Dec 07 '14 14:12

user2410644


People also ask

Which DSL does Gradle use?

The Kotlin DSL provides property extensions for all Gradle core plugins, as shown above with the java , jacoco or maven-publish declaration. Third party plugins can be applied the same way as with the Groovy DSL.

Where is the Gradle file in Android Studio?

gradle file is located inside your project folder under app/build. gradle.

What is Gradle DSL?

gradle file which helps Gradle build tool to specify this build is a debug build with certain keyAlias etc. So these building blocks, API, etc are formats to use Gradle in android, hence called Gradle DSL (domain-specific language).


1 Answers

runProguard has been renamed minifyEnabled. See the changelog here for confirmation - version 0.14.0 (2014/10/31) of the Android Gradle plugin made the swap.

Screenshot showing change location in IDE

like image 161
stkent Avatar answered Sep 23 '22 04:09

stkent