Search code examples
javaeclipsegwtlibgdx

libgdx gwt backend importing issues


So I have a libgdx project that executes perfectly fine on the desktop, but I have been having a lot of trouble trying to turn it into a web application.

The problem I'm running into right now, is that it doesn't look like I'm importing my gdx backend jars properly. Here is what my xml file looks like:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN"
  "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module rename-to='trmhtml5'>
    <inherits name='com.badlogic.gdx.backends.gdx_backends_gwt' />
    <inherits name='TeamRogueMiners' />

    <!-- Specify the app entry point class.                         -->
    <entry-point class='com.quazandwally.teamrogueminers.client.GwtLauncher'/>

    <set-configuration-property name="gdx.assetpath" value="../Android/assets" />

</module>

And this is the error I am getting:

[TRACE] [trmhtml5] - Finding entry point classes
    [ERROR] [trmhtml5] - Errors in 'file:/D:/Dev%20Dropbox/Dropbox/Eclipse/workspace/TRMHTML5/src/com/quazandwally/teamrogueminers/client/GwtLauncher.java'
        [ERROR] [trmhtml5] - Line 11: No source code is available for type com.badlogic.gdx.backends.gwt.GwtApplication; did you forget to inherit a required module?
        [ERROR] [trmhtml5] - Line 14: No source code is available for type com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration; did you forget to inherit a required module?
        [ERROR] [trmhtml5] - Line 23: No source code is available for type com.badlogic.gdx.ApplicationListener; did you forget to inherit a required module?
    [ERROR] [trmhtml5] - Unable to find type 'com.quazandwally.teamrogueminers.client.GwtLauncher'
        [ERROR] [trmhtml5] - Hint: Previous compiler errors may have made this type unavailable
        [ERROR] [trmhtml5] - Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
[ERROR] [trmhtml5] - Failed to load module 'trmhtml5' from user agent 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36' at 127.0.0.1:58554

It recognizes my TeamRogueMiners class object, but not the backend jar stuff. I've included the gdx-backend-gwt.jar under the Java Build Path, and I've added the source file as well. I put these libraries in the lib directory in the WEB-INF, which seems consistent with how the generated code does it, and also how sample projects seem to do it.

This is all with the latest release of libgdx, when I try it with the nightly build, it looks like GwtApplication doesn't have an getApplicationListener method defined to override.

Any assistance would be greatly appreciated!

This is also being done with Eclipse 4.2, on Windows 7 64 bit if any of that helps.


Solution

  • I was going to delete this, but I feel like I should answer my own question in case anyone finds this question. I didn't realize this, but setting the gdx-backend-gwt-sources.jar as a source attachment to gdx-backend-gwt-sources.jar was not enough, I also had to gdx-backend-gwt-sources.jar as a library to my project. I did the same for gdx-sources.jar. I am now on to bigger and better glitches to troubleshoot. I hope that helps any googlers.