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

Can't open a new project in the app studio

The following error shows up as soon as I open a new project in the App Studio.

Error:Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter on the daemon at http://gradle.org/docs/1.12/userguide/gradle_daemon.html

Please read below process output to find out more:

Error occurred during initialization of VM Could not reserve enough space for object heap Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

I've tried to google it but I can't find anything that works for me. I've uninstalled and reinstalled the app studio from the link on this site so it is v 0.8.2.

Also, it shows gradle project sync fail across the top

10 Answers

The sdk location is correct, I've checked it. Now I have uninstalled and reinstalled java because I thought I downloaded the 64 bit version when I have 32. That didn't change anything, even after I checked the JAVA_HOME and the new java version as well as the android sdk configuration page that asks for JDK too. Still nothing. Then I read online to change the gradle.properties file to org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m

and that fixed it. Once it could sync the problems with the preview pane disappeared too.

I used this info:

http://stackoverflow.com/questions/23663299/android-studio-gradle-project-sync-failed?rq=1

Stone Preston
Stone Preston
42,016 Points

have you tried updating Java/Java SDK

No I haven't, how can I update it?

I have windows 8.1 so I found java under my computer apps and there is a Check for Updates thing so I opened that and it said I already have the most current version. Also, I just got my preview pane to show up and it says "Renderng problem. No Android SDK found. Please configure an SDK. " When I click configure is shows C:\Users\Tracey\Downloads\android-studio-bundle-windows\android-studio\sdk and C:\Program Files\Java\jdk1.7.0_67

not sure if that has anything to do with the gradle error or if it is just further proof that I really suck at this :(

Any help is appreciated!

Michael McKenna
Michael McKenna
3,451 Points

I would definitely try Tracy's answer first. Next, close the current project (File --> close project). You'll be at the start window where you can choose Project Structure, Open an Existing Project, etc. At the very bottom left corner there should be a blue link that says "update". Click that and see if updating Android Studio helps.

Still the same. I updated and that didn't help so I deleted it all again and reinstalled it. Still cannot sync Gradle or show me the preview image.

Michael McKenna
Michael McKenna
3,451 Points

What is the new error you are getting?

Error:Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter on the daemon at http://gradle.org/docs/1.12/userguide/gradle_daemon.html

Please read below process output to find out more:

Error occurred during initialization of VM Could not reserve enough space for object heap Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

is the error showing in the gradle message thing at the bottom and it says "Gradle project sync failed. Basic functions....." it continues but the screen cannot show the whole message. This is above my code.

Then in the preview pane it says "Rendering Problems. No android SDK found. Please configure an android SDK

Michael McKenna
Michael McKenna
3,451 Points

Configure the SDK location in Project Structure. As for the Daemon error, I do not know. That has never happened to me (surprisingly because between Eclipse and Android Studio, I could swear Murphey's Law is 100% true lol!).

Michael McKenna
Michael McKenna
3,451 Points

I'm glad you found the fix!