Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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).

like image 686
David Avatar asked Jul 13 '13 22:07

David


People also ask

Which gradle version should I use in Android Studio?

For the best performance, you should use the latest possible version of both Gradle and the plugin. You can specify the Gradle version in either the File > Project Structure > Project menu in Android Studio, or update your Gradle version using the command line.

Is gradle automatically installed with Android studio?

and after completing download files, Gradle install itself automaticly.


3 Answers

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

like image 160
lyallcooper Avatar answered Oct 12 '22 16:10

lyallcooper


Basically if you follow the issues in this link for 0.2 you'll likely get yourself fixed, I had the same problems with 0.2

like image 33
Peter Fox Avatar answered Oct 12 '22 16:10

Peter Fox


Ok, I finally resolved this, by completely de-installing Android-Studio, and then installing the latest (0.2.0) from scratch.

EDIT: I also had to use the Android SDK-Manager, and install the component in the 'Extras' section called the Android Support Repository (as mentioned elsewhere).

Note: This does NOT fix my old existing project...that one still will not build, as indicated above.

But, it DOES solve the issue of now being able to at least create NEW projects going forward, that build ok using 'Gradle'. (So, basically, I re-created my proj from scratch under a new name, and copied all my code and project xml-files, etc, from the old project, into the newly-created one.)

[As an aside: I've got an idea, Google! Why don't you refer to versions of Android-Studio using numbers like 0.1.9 and 0.2.0, but then when users click on 'About' menu item, or search elsewhere for what version they are running, you could baffle them with crap like 'the July 11th build' or aka, some build number with 6 or 8 digits of numbering, and make them wonder what version they actually have! That will keep the developers guessing...really will sort the wheat from the chaff, etc.]

For example, I originally installed a kit named: android-studio-bundle-130.687321-windows.exe

Today, I got the "0.2.0" kit???, and it has a name like: android-studio-bundle-130.737825-windows.exe

Yep, this version #ing system is about as clear as mud.
Why bother with the illusion of version#s, when you don't use them!!!???

like image 32
David Avatar answered Oct 12 '22 15:10

David