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 Running the Fun Facts Project

Heather Anderson
Heather Anderson
12,591 Points

'FunFacts' project run failed - incorrect daemon configuration in gradle log

I'm trying to run the FunFacts project for the first time and keep getting the following error:

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:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0 13:46:16.562 [main] DEBUG o.g.l.daemon.bootstrap.DaemonMain - Assuming the daemon was started with following jvm opts: [-XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=UTF-8]

FAILURE: Build failed with an exception.

  • What went wrong: org/gradle/messaging/dispatch/Dispatch

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

I've confirmed that the JDK type is correct (newest version, 64-bit). Is the problem because its the newest version of the JDK and this process is no longer supported?

Thanks.

7 Answers

Hi Heather, try this File->Invalid caches/Restart->Invalidate caches and restart once the Android studio restarts and reloads check and see if it works. If it doesn't let us know.

Heather Anderson
Heather Anderson
12,591 Points

Hi gloria, I have switched up the versions of Java (from 8 to 7) and restarted the machines. There wasn't this error anymore - awesome!

However, the same error came back when trying to sync the a running emulator with the project's xml file.

After doing your suggestion and clearing the cache, the following error appears. It appears to be related in some way to the last error.

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:

15:27:15.643 [main] DEBUG o.g.l.daemon.bootstrap.DaemonMain - Assuming the daemon was started with following jvm opts: [-XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=UTF-8]

FAILURE: Build failed with an exception.

  • What went wrong: Could not create service of type DaemonContext using DaemonServices.createDaemonContext().

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

The app will not run (won't mirror the xml inside Android Studio). When clicking 'Run', this error about this daemon shows up and halts gradle from running the app.

Are you running android studio with administrator privileges? If not try right clicking and select "Run as Administrator". Let me know if you still have issues after that.

Heather Anderson
Heather Anderson
12,591 Points

To be clear, I'm running

sudo /Applications/Android Studio.app/Contents/MacOS/studio

and can launch as root.

This is what the app looks like when doing so:

![][http://postimg.org/image/i2i94lopf/]

You can find the executable through Mac finder feature I assume. I don't have a Mac though (I have used one before), but I don't remember it clearly.

Try this instead first. I think it might solve your issue, it did for me at least when I had similar issue at some point. Go to File->Settings->Gradle-> and set VM Options: -Xmx512m . Apply the changes restart your Android Studio and see if it works.

Heather Anderson
Heather Anderson
12,591 Points

Bad news, I'm afraid. There's an internal error now on startup and the app won't launch.

I have tried re-installing from .dmg but this same error appears each time (warning... a long one)

Internal error. Please report to http://code.google.com/p/android/issues

java.lang.RuntimeException: com.intellij.ide.plugins.PluginManager$StartupAbortedException: Fatal error initializing 'com.intellij.util.indexing.FileBasedIndex' at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:159) at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:46) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715) at java.awt.EventQueue.access$400(EventQueue.java:82) at java.awt.EventQueue$2.run(EventQueue.java:676) at java.awt.EventQueue$2.run(EventQueue.java:674) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86) at java.awt.EventQueue.dispatchEvent(EventQueue.java:685) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:697) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Caused by: com.intellij.ide.plugins.PluginManager$StartupAbortedException: Fatal error initializing 'com.intellij.util.indexing.FileBasedIndex' at com.intellij.ide.plugins.PluginManager.handleComponentError(PluginManager.java:244) at com.intellij.openapi.components.impl.PlatformComponentManagerImpl.handleInitComponentError(PlatformComponentManagerImpl.java:39) at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:570) at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:590) at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:225) at com.intellij.util.pico.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:212) at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:199) at org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer.getComponentInstance(AbstractDelegatingMutablePicoContainer.java:75) at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponent(ComponentManagerImpl.java:121) at com.intellij.openapi.application.impl.ApplicationImpl.createComponent(ApplicationImpl.java:371) at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:112) at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:89) at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl.load(ApplicationStoreImpl.java:87) at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:508) at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:151) ... 18 more Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /Users/heatheranderson/Library/Caches/AndroidStudioBeta/index/android.value.resources.index/android.value.resources.index.ver (Permission denied) at com.intellij.util.indexing.FileBasedIndexImpl.initExtensions(FileBasedIndexImpl.java:332) at com.intellij.util.indexing.FileBasedIndexImpl.initComponent(FileBasedIndexImpl.java:359) at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:548) ... 30 more Caused by: java.io.FileNotFoundException: /Users/heatheranderson/Library/Caches/AndroidStudioBeta/index/android.value.resources.index/android.value.resources.index.ver (Permission denied) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:194) at java.io.FileOutputStream.<init>(FileOutputStream.java:145) at com.intellij.util.indexing.IndexInfrastructure$1.execute(IndexInfrastructure.java:95) at com.intellij.util.indexing.IndexInfrastructure$1.execute(IndexInfrastructure.java:90) at com.intellij.openapi.util.io.FileUtilRt.doIOOperation(FileUtilRt.java:517) at com.intellij.util.indexing.IndexInfrastructure.rewriteVersion(IndexInfrastructure.java:90) at com.intellij.util.indexing.FileBasedIndexImpl.initIndexStorage(FileBasedIndexImpl.java:461) at com.intellij.util.indexing.FileBasedIndexImpl.registerIndexer(FileBasedIndexImpl.java:393) at com.intellij.util.indexing.FileBasedIndexImpl.initExtensions(FileBasedIndexImpl.java:290) ... 32 more

... Not sure what to do now. Help, please!

Wow, hmmm, I suggest you reset your android studio. Since you are on MAC OS you can reset Android studio by closing android studio and doing removing the following directories.

~/Library/Application Support/AndroidStudioBeta

~/Library/Caches/AndroidStudioBeta

~/Library/Logs/AndroidStudioBeta

~/Library/Preferences/AndroidStudioBeta"

Then restart android studio and let me know if it works.

Heather Anderson
Heather Anderson
12,591 Points

That worked like a charm!

I'm going to continue by recreating the tutorial project and let you know how it goes. Thank you so much for those instructions!

You are welcome :) Awesome!