简体   繁体   English

无法在Android Studio(libGDX)中运行项目

[英]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: 每次我尝试在Android Studio中运行我的桌面项目时,我立即收到以下错误:

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

No gradle build happens, or any sort of syncing. 没有发生gradle构建或任何类型的同步。 Android Studio just jumps straight to this error. Android Studio直接跳转到此错误。

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. 我已经重启/无效缓存,我已经在项目和家庭位置删除了我的.gradle文件夹,我重新安装了android studio,我创建了一个新项目,但我仍然得到同样的错误。

When I run the gradle build manually, the build completes successfully. 当我手动运行gradle构建时,构建成功完成。 I can even run the Android project with no problems. 我甚至可以毫无问题地运行Android项目。 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). 我使用的是最新版本的android gradle(2.3.0),而我的JDK是正确的版本(1.8)。

I am getting this error after updating to Android Studio 2.3. 我在更新到Android Studio 2.3后收到此错误。

To clarify, the Gradle build/sync completes SUCCESSFULLY. 为了澄清,Gradle构建/同步完成了SUCCESSFULLY。

UPDATE: It looks like this issue may have been fixed in RoboVM 2.3.2: https://github.com/MobiVM/robovm/issues/115#issuecomment-303979058 更新:在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 听起来你可能需要恢复到Android Studio 2.2,你可以在这里下载: 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: “消息”中的错误消息没有帮助,但如果您转到Help->Show Log in Finder ,您将看到一些更有用的额外信息:

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 事实证明RoboVm与Android Studio 2.3(尚未)兼容: 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. 回到Android Studio 2.2.3后,我可以正常运行桌面应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM