73
/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/bin/java "- com.intellij.rt.execution.application.AppMain org.gradle.launcher.GradleMain --build-file /Users/Tom/Documents/Git_open_sources/android-material-drawer-template/app/build.gradle

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/Tom/Documents/Git_open_sources/android-material-drawer-template/app/build.gradle' line: 16

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find method runProguard() for arguments [false] on BuildType_Decorated{name=release, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, applicationIdSuffix=null, versionNameSuffix=null, minifyEnabled=false, zipAlignEnabled=true, signingConfig=null, embedMicroApp=true, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}}.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 6.741 secs

Process finished with exit code 1

apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.1.0"

defaultConfig {
    applicationId "com.poliveira.apps.materialtests"
    minSdkVersion 11
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:21.0.0'
//noinspection GradleDependency
compile "com.android.support:appcompat-v7:21.0.0"
compile 'com.android.support:recyclerview-v7:21.0.0'
}    
Tim
  • 41,901
  • 18
  • 127
  • 145
Tom_Love_Jerry
  • 749
  • 1
  • 5
  • 9

6 Answers6

185

I had the same problem after updating android studio to 1.0 RC 3. I couldn't import my project to new version. i had to create a new project and add the files to the new project from the previous project manually.

After that I found a change in the gradle build file.

Here is the change:

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

Instead of "runProguard false" use "minifyEnabled false"

Sazedul Islam Sazid
  • 2,258
  • 1
  • 10
  • 10
  • Works for me (after Updating to 1.0"final"). Should to be updated too: Gradle 2.2 (or above) "SDK-Tools" Support Repository Support Library Play Services etc,etc, – ieselisra Dec 12 '14 at 08:46
35

There is an update with Android Studio, you need to migrate your Gradle configurations : http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0

  • Replace runProguard with minifyEnabled
  • Replace zipAlign with zipAlignEnabled
  • etc...
Gautier Drusch
  • 701
  • 5
  • 16
12

Works for me (after updating to 1.0 "final"):

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

Should to be updated too: Gradle 2.2 (or above), "SDK-Tools", Support Repository, Support Library, Play Services, etc,etc,

TofferJ
  • 4,678
  • 1
  • 37
  • 49
ieselisra
  • 387
  • 4
  • 16
10

Instead of using runProguard in your gradle file, try using minifyEnabled. This should fix the issue. runProguard is deprecated and soon be stop working.

NOTE - To use minifyEnabled, gradle should be updated to version 2.2 or above.

Varundroid
  • 9,135
  • 14
  • 63
  • 93
2

don't forget to change all renderscriptSupportMode to renderscriptSupportModeEnabled !

Also thoose who are in all your libs's project

0

you need to do couple of things to migrate from 0.9 to 1.0 see http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0

Netero
  • 3,761
  • 2
  • 29
  • 29