Android-Studio upgraded from 0.1.9 to 0.2.0 causing gradle build errors now

android-studio, gradle

Solution

Solution for me without reinstalling or creating a new project:

Step 1: Change line in `build.gradle` from:

dependencies {
    classpath 'com.android.tools.build:gradle:0.4'
}

to

dependencies {
    classpath 'com.android.tools.build:gradle:0.5.+'
}

Note: for newer versions of gradle you may need to change it to `0.6.+` instead.

Step 2: In the `<YourProject>.iml` file, delete the entire`<component name="FacetManager">[...]</component>` tag.

Step 3 (Maybe not necessary): In the Android SDK manager, install (if not already installed) `Android Support Repository` under Extras.

Info found here

Problem

My current project had been building with Gradle just fine, since I created it (about a month ago), after acquiring Android-Studio. [I installed some earlier updates to Android-Studio, and had no problems with those.] But, today, after I upgraded Android-Studio's newest update to a "July 11th" build, going from version 0.1.9 to 0.2.0, my project started complaining that Gradle now needs to be at minimum of 0.5.0. (My project was asking for Gradle 0.4, and this new Studio upgrade flagged my Gradle build and stated it would NOW need this new higher minimum of Gradle. So, what I'm unclear about: I've been assuming Gradle is PART of (bundled with) Android Studio. Do I now need to get a newer Gradle, as a separate product/update? I'm confused!!! EDIT: (This is happening under Windows-7).

Original source