【问题标题】:libgdx gwt backend importing issueslibgdx gwt 后端导入问题
【发布时间】:2013-10-27 10:19:36
【问题描述】:

所以我有一个 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 位上完成。

【问题讨论】:

    标签: java eclipse gwt libgdx


    【解决方案1】:

    我打算删除这个,但我觉得我应该回答我自己的问题,以防有人发现这个问题。我没有意识到这一点,但是将gdx-backend-gwt-sources.jar 设置为gdx-backend-gwt-sources.jar 的源附件是不够的,我还必须将gdx-backend-gwt-sources.jar 作为我项目的库。我对gdx-sources.jar 做了同样的事情。我现在要解决更大更好的故障。我希望这对任何谷歌员工有所帮助。

    【讨论】:

    • 确实如此。非常感谢!
    • 我其实不知道-sources.jar's。我被要求编译应用程序,它不是我的应用程序,如果麻烦你帮了我很多。
    猜你喜欢
    • 1970-01-01
    • 2023-03-16
    • 2017-02-06
    • 2016-05-13
    • 1970-01-01
    • 2023-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多