Search code examples
android-studiogradlelibgdxlwjgl

Error: Failed to resolve: com.badlogicgames.gdx:gdx-backend-lwjgl:1.6.5


I used gdx-setup.jar to generate a gradle project and then imported it inside Android Studio. But when I try to compile it, I get this error.

I checked the "desktop" + "Android" option while generating and use Android API 20. When I navigated inside the project, I found that in the DesktopLauncher.java class LwjglApplicationConfiguration appears red. The import statements

import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;

are both marked with errors. "lwjgl" is red and upon hovering over shows "Couldn't resolve symbol 'lwjgl' in blah blah"

Whats wrong?


Solution

  • Its fixed.

    For some strange reason, the gdx-setup.jar file was not downloading lwjgl jar files into the .gradle folder in C:\Users\. Not sure why this was happening, maybe a bug. I went to Advanced settings and checked "IDEA" and then clicked generate. This time it downloaded a whole load of jar files. After it finished, I regenerated again by unchecking "IDEA" so that I would get a Gradle based build.

    Finally it works. Maybe there's a bug in gdx-setup.jar