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 Data Persistence File Storage Reading from Internal Storage

Alex Hedley
Alex Hedley
16,381 Points

Method Not Found 'runProguard()'

I didn't use the build that was provided when viewing the course project so I expected errors.

Thought I'd add this here in case others get the same issue.

Error:(27, 0) Gradle DSL method not found: 'runProguard()'
**Possible causes:
The project 'Atomic4Mobile' 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 plugin**

The fix for this is to change your build.gradle file

Swap "runProguard false" to "minifyEnabled false"

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

Background info: Caused by Android Studio 0.9 to 1.0 transition, runProguard() is deprecated

2 Answers

Luke Liem
Luke Liem
6,367 Points

The Starter Files provided by Treehouse in this case is generated with Version 0.8.6. So if you are using a newer version of Android Studio (Version 1.0 and above), you need to read the following blog:

http://www.goprogramming.space/importing-older-android-studio-code-example-projects-into-android-studio-1-1-0-step-by-step-guide/

It is a step-by-step guide for importing projects created by older Android Studio versions:

"People started making Android Apps with Android Studio 2 years ago when the first Pre-Developer-Not-At-All-Ready-Version was released.

The developing process of Android Studio took about 1 1/2 years before the first 1.0 version was finished. In this time, many things have changed all the time. Developers made apps during the whole time with a bunch of different versions of Android Studio.

Many of this Source Code examples have never been updated and most of them are not compatible with the recent version of Android Studio....."