1

I have recently migrated from Eclipse to Android Studio. I am facing some problems regarding Gradle.

I tried to import this project from github: https://github.com/saulmm/Android-Material-Example, but got this error message:

Error:(16, 0) Gradle DSL method not found: 'runProguard()' Possible causes:

  • The project 'Android-Material-Example-master' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file
  • The build file may be missing a Gradle plugin. Apply Gradle plugin
  • This is my build.gradle

    // 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'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        } }
    
    allprojects {
        repositories {
            jcenter()
        } }
    

    And this is my gradle-wrapper.properties

    #Wed Apr 10 15:27:10 PDT 2013 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
    

    I can't find runProguard() they are talking about! Any solutions?

    serv-inc
    • 35,772
    • 9
    • 166
    • 188
    Hamzeh Soboh
    • 7,572
    • 5
    • 43
    • 54
    • 1
      check your each `build.gradle` files and replace the occurences of `runProguard()` to `minifyEnabled false` – Nitin Misra Jan 22 '15 at 11:07
    • 2
      Within the **app** folder in that Github project is a **build.gradle** file with the line `runProguard false`. Change this line to read `minifyEnabled false` – Joel Jan 22 '15 at 11:10
    • You're right, I was checking the wrong build.gradle file! – Hamzeh Soboh Jan 22 '15 at 12:34

    1 Answers1

    2

    Try this one in the build.gradle:

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 20
        buildToolsVersion "20.0.0"
    
        defaultConfig {
            applicationId "package"
            minSdkVersion 14
            targetSdkVersion 20
            versionCode 1
            versionName "1.0.0"
        }
    
        buildTypes {
            release {
    
            /**
            *
            * Here is the change that must be done
            *
            **/
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    
    }
    
    buildscript {
    
    }
    
    repositories {
    
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:support-v13:19.+'
    }
    
    Lennon Spirlandelli
    • 3,131
    • 5
    • 26
    • 51
    • Thanks. But now it gives me: 'Error inflating class android.support.v7.widget.Toolbar'. I'm running on a device of Android API16 installed, but compileSdkVersion is much higher. – Hamzeh Soboh Jan 23 '15 at 19:37
    • Please, take a look http://stackoverflow.com/questions/26561235/error-inflating-class-android-support-v7-widget-toolbar Perhaps it can help you – Lennon Spirlandelli Jan 24 '15 at 22:00