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 Build an Interactive Story App (Retired) Intents and Multiple Activities Adding a Second Activity

Gradle Project Sync Failed

So I messed all my code up and decided to get rid of it and download the project files here in the downloads area. I did that and replaced the project folder back where it belonged. When I bring my project up and try to work with it, it says the following. (This didn't happen with my project before I tried using then new files.)

The path 'C:\Users\Andrew\AndroidStudioProjects\InteractiveStory\Applications\ Android Studio.app\sdk' does not refer to an Android SDK

Android Studio will use its default SDK instead: 'C:\Users\Andrew\AppData\Local\Android\sdk' and will modify the project's local.properties file.

I click okay because its the only thing I can do.

It than tells me that the Gradle project sync failed. Basic functionality will not work properly.

in the Messages area it says:

Error:The project is using an unsupported version of the Android Gradle plug-in (0.12.2). The recommended version is 1.0.0. <a href="fixGradleElements">Fix plugin version and re-import project</a>

I click fix plugin version and it still gives me errors.

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

I was wondering if anyone could help me with this. Thanks!

Hey Andrew,

Try this:

in the applications build.gradle file, Change this:

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

To this:

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

Does that resolve it?

4 Answers

I have the same problem. Brett my build.gradle file doesn't read that way. mine says...

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

Does anyone have a solution for this? I could really use the help.

hey Joel, Try this. Take out out the line that says: runProGuard false and replace it with: minifyEnabled false.

Does that fix it? if it doesn't can post your whole Gradle Sync message output?

Thanks for getting back to me Brett. I did find a solution that worked for me.

On line 16 of the build.gradle replace "runProguard true (or false)" with "minifyEnabled true"

Then Save, Clean and rebuild. You'll get a message that it will update the language. I allowed it to rebuild and then it was good to go!

Joel

Error:(16) A problem occurred evaluating project ':app'.

Could not find method minifyProguard() for arguments [true] 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={}}.

I get the above error on trying to edit build.gradle replacing "runProguard false" with "minifyEnabled true"

Done now. I had put the assets folder in the traditional res folder. Now in this later version of android studio 1.2, the assets folder has got to be in the src/main folder. Also, it seemed changing runProguard false to minifyEnabled true must be done allowing the autocomplete.