1

I, like many others, am having the problem where when I import a project from eclipse into Android Studio, it will not work. I am consistently getting this error:

enter image description here

At the bottom of the screen, the following message appears:

enter image description here

I have followed the steps / recommendations from the following links but without any success: 1) android studio 0.8.1: Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly 2) Android Studio - Gradle sync project failed

Does anyone have ANY recommendations for me as I have been pulling my hair out just trying to get 1 simple hello world project imported in from eclipse without success...

-Sil

Community
  • 1
  • 1
PGMacDesign
  • 6,092
  • 8
  • 41
  • 78
  • Check out the answers to these other two posts: http://stackoverflow.com/questions/4401396/could-not-reserve-enough-space-for-object-heap and http://stackoverflow.com/questions/26143740/getting-gradle-error-could-not-reserve-enough-space-for-object-heap-constantly. Seems you need to increase the heap memory for gradle ("Could not reserve enough space for object heap") – velval Nov 18 '14 at 22:33
  • More likely this signals a lack of free memory. – Peter Niederwieser Nov 19 '14 at 00:45
  • Tried both of those, seems like the system was screwing with us (Red Herring style). See the answer I posted below for details – PGMacDesign Nov 19 '14 at 06:11

2 Answers2

1

This is appearing because: Maybe your eclipse project has minimum SDK version lesser than SDKs installed in your computer.

To resolve this error: First check which SDKs you have installed in your system. If you don't have the desired(must be older) SDK then you can download older SDK and it'll work. OR

  1. Open Project from left sidebar.
  2. Go to "App Name" > app > build.gradle
  3. Search for "compileSdkVersion x", that should be in line 4.
  4. change x with 14 (here I assume that you have SDK level 14 installed)
  5. Click on "Try Again".
  6. A dialog box will appear asking you to reload project. Select yes.
  7. Now you have successfully imported a project.

This works perfectly for me as I don't want to install older SDKs.

TheOnlyAnil
  • 877
  • 1
  • 15
  • 27
0

Ok. So. Although it seems extremely likely that it is memory related as that is what the error indicates, it was apparently more simple to fix than that.

Follow these steps and see if it helps you:

1) Go to http://www.gradle.org/downloads and download the newest version (Binaries only)

2) Navigate in explorer to the folder: C:\Users\username\ .gradle\wrapper\dists and extract the contents into this folder

3) Close Android Studio and reopen it. It will display the same error again, click on the icon here:

enter image description here

That should do the trick. (At least it did for me).

-Sil

PGMacDesign
  • 6,092
  • 8
  • 41
  • 78