所以我有一个 libgdx 项目,它在桌面上执行得非常好,但是我在尝试将它变成一个 Web 应用程序时遇到了很多麻烦。
我现在遇到的问题是,我似乎没有正确导入我的 gdx 后端 jar。这是我的 xml 文件的样子:
<?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>
这是我得到的错误:
[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
它识别我的 TeamRogueMiners 类对象,但不能识别后端 jar 的东西。我在 Java 构建路径下包含了 gdx-backend-gwt.jar,并且还添加了源文件。我将这些库放在WEB-INF 的lib 目录中,这似乎与生成的代码的执行方式以及示例项目的执行方式一致。
这就是最新版本的 libgdx,当我尝试使用每晚构建时,看起来 GwtApplication 没有定义要覆盖的 getApplicationListener 方法。
任何帮助将不胜感激!
这也可以通过 Eclipse 4.2 在 Windows 7 64 位上完成,如果有任何帮助的话。