Search code examples
javalibgdxopen-source

libgdx source code build errors cannot resolve to a type


I'm having trouble setting up the Libgdx source code, I've followed both these setup guides: https://github.com/libgdx/libgdx/wiki/Setting-up-your-Development-Environment-%28Eclipse%2C-Intellij-IDEA%2C-NetBeans%29

https://github.com/libgdx/libgdx/wiki/Running-demos-%26-tests

I've downloaded the source, have the latest version of the JDK, have the Android SDK for android 25 installed, and have done all the other steps (as far as I know correctly), yet I have thousands of errors on my libgdx setup, even when I try cleaning and rebuilding. The errors are all along the lines of "Cannot be resolved to a type". Anybody know what step I may have messed up?

Also, I tried running "ant", which they forgot to mention in the running demos page, and that still has not resolved the issue.

Could it be that I'm using a Java 8 JDK, while libgdx is still on Java 7?

Description Resource    Path    Location    Type
AnimationCallback cannot be resolved to a type  GwtApplication.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt line 214    Java Problem
AnimationScheduler cannot be resolved   GamepadSupport.java /gdx-controllers-gwt/src/com/badlogic/gdx/controllers/gwt/support   line 143    Java Problem
AnimationScheduler cannot be resolved   GamepadSupport.java /gdx-controllers-gwt/src/com/badlogic/gdx/controllers/gwt/support   line 156    Java Problem
AnimationScheduler cannot be resolved   GwtApplication.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt line 214    Java Problem
AnimationScheduler cannot be resolved   GwtApplication.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt line 223    Java Problem
AnimationScheduler cannot be resolved to a type GamepadSupport.java /gdx-controllers-gwt/src/com/badlogic/gdx/controllers/gwt/support   line 136    Java Problem
ArrayBuffer cannot be resolved to a type    DirectByteBuffer.java   /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio    line 43 Java Problem
ArrayBuffer cannot be resolved to a type    DirectByteBuffer.java   /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio    line 47 Java Problem
ArrayBuffer cannot be resolved to a type    DirectReadOnlyByteBuffer.java   /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio    line 41 Java Problem
ArrayBuffer cannot be resolved to a type    DirectReadWriteByteBuffer.java  /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio    line 41 Java Problem
ArrayBuffer cannot be resolved to a type    DirectReadWriteByteBuffer.java  /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio    line 49 Java Problem
ArrayBuffer cannot be resolved to a type    WebGLRenderingContext.java  /gdx-backends-gwt/src/com/google/gwt/webgl/client   line 569    Java Problem
ArrayBuffer cannot be resolved to a type    WebGLRenderingContext.java  /gdx-backends-gwt/src/com/google/gwt/webgl/client   line 577    Java Problem
ArrayBufferNative cannot be resolved    DirectByteBuffer.java   /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio    line 40 Java Problem
ArrayBufferView cannot be resolved to a type    DirectByteBuffer.java   /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio    line 52 Java Problem
ArrayBufferView cannot be resolved to a type    DirectReadOnlyFloatBufferAdapter.java   /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio    line 138    Java Problem
ArrayBufferView cannot be resolved to a type    DirectReadOnlyIntBufferAdapter.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio    line 138    Java Problem
ArrayBufferView cannot be resolved to a type    DirectReadOnlyShortBufferAdapter.java   /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio    line 137    Java Problem
ArrayBufferView cannot be resolved to a type    DirectReadWriteFloatBufferAdapter.java  /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio    line 155    Java Problem
ArrayBufferView cannot be resolved to a type    DirectReadWriteIntBufferAdapter.java    /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio    line 153    Java Problem
ArrayBufferView cannot be resolved to a type    DirectReadWriteShortBufferAdapter.java  /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio    line 155    Java Problem
ArrayBufferView cannot be resolved to a type    GwtGL20.java    /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt line 881    Java Problem
ArrayBufferView cannot be resolved to a type    GwtGL20.java    /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt line 882    Java Problem
ArrayBufferView cannot be resolved to a type    GwtGL20.java    /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt line 929    Java Problem
ArrayBufferView cannot be resolved to a type    GwtGL20.java    /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt line 930    Java Problem
ArrayBufferView cannot be resolved to a type    HasArrayBufferView.java /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/nio    line 23 Java Problem
ArrayBufferView cannot be resolved to a type    ScreenUtils.java    /gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/com/badlogic/gdx/utils  line 89 Java Problem
ArrayBufferView cannot be resolved to a type    WebGLRenderingContext.java  /gdx-backends-gwt/src/com/google/gwt/webgl/client   line 565    Java Problem
ArrayBufferView cannot be resolved to a type    WebGLRenderingContext.java  /gdx-backends-gwt/src/com/google/gwt/webgl/client   line 573    Java Problem
ArrayBufferView cannot be resolved to a type    WebGLRenderingContext.java  /gdx-backends-gwt/src/com/google/gwt/webgl/client   line 829    Java Problem

Solution

  • Have you added required .jars file in java build path.

    Add required jars in Eclipse by right-clicking on the Project → Build Path → Configure Build Path. Under Libraries tab, click Add Jars or Add External JARs and give the Jar.