Tuesday, March 05, 2019

LibGDX Setup Problem

LibGDX is a complex technology, which utilizes lots of other complex technologies, so getting a project up-and-running the first time can have a few problems.  Here's a rundown of the problems I experienced, along with solutions. 

This article assumes you are using Eclipse and running the default "blank" project (which shows the LibGDX logo).


Eclipse Error: GWT jar missing:

Do an Eclipse "quick fix"

Eclipse Error: Web.xml missing:

Move the web.xml to \war\web-inf

Running the program, get the error "File not found: badlogic.jpg"

The application will fail the first time. Open the Run Configuration you just created and set the working directory to the android/assets/ directory.
Go to Run => Run Configurations.. => choose DesktopLauncher, Arguments Tab => Working Directory => Others then browse to yourproject-android/assets/ and click Apply
https://stackoverflow.com/questions/22822767/file-not-found-when-running-new-libgdx-project

Eclipse Error: EntryPoint not found

You need to download the Gradle plugin for Eclipse, from http://gwt-plugins.github.io/documentation/gwt-eclipse-plugin/Download.html


Running Gradle, get error "could not reserve space for object heap"

Check you're using 64bit java for Gradle.
If that doesn't work, add the environment variable "_JAVA_OPTIONS" (with the underscore) and set it to something higher, like "-Xms256m -Xmx2500m".


--
Hopefully, once you've got through all those problems, your project should work!

No comments: