Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Android studio won't run my FunFacts project

When I attempt to open the project the app gives error message...

!Error (17,0) Gradle DSL method not found 'runProguard()'

The project FunFacts may be using a version of gradle that does not contain the method. Gradle settings

The build file may be missing a gradle plugin Apply gradle plugins

1 Answer

Hello,

Change runProguard to minifyEnabled in your build.gradle file. This was changed around the 1.0 release for Android Studio.

Thank you for answering! I've located the app's build.gradle file and pasted the code below. I want to be sure I'm following your advice correctly. There's a line that reads runProguard false. Should I change that code read minifyEnabled false?

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.example.whitn_000.funfacts"
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            apply plugin: 'java'
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

That should be everything you need to do to get it working.