Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to run project in Android Studio (libGDX)

Every time I try to run my Desktop project in Android Studio, I instantly get the following error:

Error:com.android.tools.idea.gradle.util.Projects.lastGradleSyncFailed(Lcom/intellij/openapi/project/Project;)Z

No gradle build happens, or any sort of syncing. Android Studio just jumps straight to this error.

I have restart/invalidated caches, I have deleted my .gradle folder in both project and home locations, I have reinstalled android studio, I have created a new project, but I still get the same error.

When I run the gradle build manually, the build completes successfully. I can even run the Android project with no problems. It is just the Desktop project that is giving me problems.

Any suggestions would be much appreciated.

I am using the latest version of android gradle (2.3.0), and my JDK is the correct version (1.8).

I am getting this error after updating to Android Studio 2.3.

To clarify, the Gradle build/sync completes SUCCESSFULLY.

like image 525
Matthew Tory Avatar asked Mar 04 '17 22:03

Matthew Tory


1 Answers

UPDATE: It looks like this issue may have been fixed in RoboVM 2.3.2: https://github.com/MobiVM/robovm/issues/115#issuecomment-303979058


It sounds like you may need to revert back to Android Studio 2.2, which you can download here: http://tools.android.com/download/studio/builds/android-studio-2-2-3

I had the same problem. The error message in "Messages" isn't helpful, but if you go to Help->Show Log in Finder, you'll see some extra information that's a little more useful:

2017-03-06 17:52:27,615 [4546022]   INFO - ij.compiler.impl.CompileDriver - java.lang.NoSuchMethodError: com.android.tools.idea.gradle.util.Projects.lastGradleSyncFailed(Lcom/intellij/openapi/project/Project;)Z
    at org.robovm.idea.components.RoboVmBuildProcessParametersProvider.getVMArguments(RoboVmBuildProcessParametersProvider.java:60)
    at com.intellij.compiler.server.BuildManager.launchBuildProcess(BuildManager.java:1136)
    at com.intellij.compiler.server.BuildManager.lambda$null$11(BuildManager.java:730)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at com.intellij.util.concurrency.BoundedTaskExecutor.runFirstTaskThenPollAndRunRest(BoundedTaskExecutor.java:178)
    at com.intellij.util.concurrency.BoundedTaskExecutor.access$000(BoundedTaskExecutor.java:40)
    at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:197)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

It turns out RoboVm isn't compatible with Android Studio 2.3 (yet): https://github.com/MobiDevelop/robovm/issues/115

After I went back to Android Studio 2.2.3, I could run the Desktop application just fine.

like image 148
richkzad Avatar answered Oct 19 '22 08:10

richkzad