3

I am having problems importing the SampleApps for GooglePlayGames (Git: https://github.com/playgameservices/android-samples.git) in Android Studio.

I followed the guide on https://github.com/playgameservices/android-samples#if-youre-using-android-studio but the IDE shows some strange errors. I have to say that I haven't used Android Studio and Gradle very often...

This is the error:

Gradle 'BasicSamples' project refresh failed: A fatal exception has occurred. Program will exit.

I installed Android Studio "0.4.2" and updated to "0.4.6". On both versions the error occured.

  • OS: Windows 7 (64Bit)
  • JDK: Oracle 1.7.0_45 (64Bit)

Below is a screenshot from the IDE and its current setup after importing the project. enter image description here

The more informative idea log shows the following error:

com.intellij.openapi.externalSystem.model.ExternalSystemException: A fatal exception has occurred. Program will exit. at org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper.execute(GradleExecutionHelper.java:185) at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:115) at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:63) at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41) at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37) at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59) at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37) at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49) at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:48) at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:137) at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:123) at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:471) at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4$2.run(ExternalSystemUtil.java:549) at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:464) at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178) at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212) at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171) at com.intellij.openapi.progress.impl.ProgressManagerImpl$8.run(ProgressManagerImpl.java:373) at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:420) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:150) 2014-02-28 08:43:58,169 [ 16187] WARN - .project.GradleProjectImporter -
2014-02-28 08:43:58,169 [ 16187] INFO - .project.GradleProjectImporter - A fatal exception has occurred. Program will exit.

Any idea what could lead to this failure? I followed the guide on android studio 0.4.2: Gradle project sync failed error but that didn't solve the problem.

Community
  • 1
  • 1
tim.kaufner
  • 1,247
  • 5
  • 13
  • 22

2 Answers2

3

I have no clue why its working now... After multiple restarts from the IDE the project is being built successfully. Now the ".iml" files are shown in each of the sample app.

Never mind... I guess its something about the beta state from Android Studio ;)

tim.kaufner
  • 1,247
  • 5
  • 13
  • 22
  • I had this same problem on a windows machine, fresh install. Restarting the machine fixed it for me. – janakagamini Apr 08 '14 at 04:53
  • 1
    Sad state of Gradle integration with IntelliJ/Android Studio as of now. I liked the integrated build system+maven better :( PS: Restart of IDE worked for me – Nilzor May 23 '14 at 13:04
1

I had the same problem when my debug process was started

by: https://code.google.com/p/android/issues/detail?id=67946

Problem -> The program never exists, this error will appear, when either trying to make, rebuild or clean. Android Studio will not detect any code changes or compilation errors within the code, and if you try to run, you'll get the same error but the app will still launch, however, on the previous build that was actually completed.

Solution -> A restart of the PC seems to fix this and sometimes a restart of Android Studio however, not found anything patterns that actually cause this issue to begin with.