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 a Simple Android App (2014) Getting Started with Android Setting Up an Android Development Environment for Windows

Gradle execution error.

I followed the instructions to install android studio and java. When I create a new project in android studio after the project is built I am prompted Gradle execution error.

This is using the provided zip file. I tried deleting the .gradle file and unzipping it again but the same error occurred. I'm running windows 7.

Harry James
Harry James
14,780 Points

Can you provide the full error log here please?

2 Answers

Android Studio was just updated to version 1.0. This has caused a few incompatibilities when opening up older projects. If it's complaining about proguard() method not found, open up the 'build.gradle' under the 'app' directory (not the one at the top level project directory) and change the line 'runProguard false' to 'minifyEnabled false'

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion '21.1.0'

    defaultConfig {
        applicationId "com.teamtreehouse.funfacts"
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
//            runProguard false // change this old method
            minifyEnabled false // to this
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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

After the project was built a prompt would say along the lines of "gradle execution error. Fatal error closing program" with no gradle log. So I deleted the .Gradle folder and unzipped the Android studio folder to a new path. It ended up working in my C:/Program Files which is strange because I run eclipse out of my ~/ path perfectly fine.