1

最近我开始了解这个很棒的框架,即 Libgdx。我对这个框架完全陌生,因此一些障碍是显而易见的。我已经克隆了整个存储库,并且还运行了 gdx-setup-ui.jar 文件。它给了我 4 个基本的入门项目。(my-gdx-game, my-gdx-game-android, my-gdx-game-desktop, my-gdx-game-html) android 和桌面项目运行良好,但是,当我尝试运行 HTML5 项目时,点击 URL 链接后,我遇到了这个错误,

[TRACE] [com.me.mygdxgame.GwtDefinition] - Finding entry point classes
[ERROR] [com.me.mygdxgame.GwtDefinition] - Errors in 'com/badlogic/gdx/backends/gwt/GwtApplication.java'
[ERROR] [com.me.mygdxgame.GwtDefinition] - Line 273: No source code is available for type com.badlogic.gdx.Net; did you forget to inherit a required module?
[ERROR] [com.me.mygdxgame.GwtDefinition] - Line 393: No source code is available for type com.badlogic.gdx.utils.Clipboard; did you forget to inherit a required module?
[ERROR] [com.me.mygdxgame.GwtDefinition] - Errors in 'com/badlogic/gdx/Application.java'
[ERROR] [com.me.mygdxgame.GwtDefinition] - Line 117: No source code is available for type com.badlogic.gdx.Net; did you forget to inherit a required module?
[ERROR] [com.me.mygdxgame.GwtDefinition] - Line 159: No source code is available for type com.badlogic.gdx.utils.Clipboard; did you forget to inherit a required module?
[ERROR] [com.me.mygdxgame.GwtDefinition] - Errors in 'com/badlogic/gdx/backends/gwt/GwtNet.java'
[ERROR] [com.me.mygdxgame.GwtDefinition] - Line 12: No source code is available for type com.badlogic.gdx.Net; did you forget to inherit a required module?
[ERROR] [com.me.mygdxgame.GwtDefinition] - Line 14: No source code is available for type com.badlogic.gdx.Net.HttpResult; did you forget to inherit a required module?
[ERROR] [com.me.mygdxgame.GwtDefinition] - Line 24: No source code is available for type com.badlogic.gdx.net.ServerSocket; did you forget to inherit a required module?
[ERROR] [com.me.mygdxgame.GwtDefinition] - Line 24: No source code is available for type com.badlogic.gdx.Net.Protocol; did you forget to inherit a required module?
[ERROR] [com.me.mygdxgame.GwtDefinition] - Line 24: No source code is available for type com.badlogic.gdx.net.ServerSocketHints; did you forget to inherit a required module?
[ERROR] [com.me.mygdxgame.GwtDefinition] - Line 29: No source code is available for type com.badlogic.gdx.net.Socket; did you forget to inherit a required module?
[ERROR] [com.me.mygdxgame.GwtDefinition] - Line 29: No source code is available for type com.badlogic.gdx.net.SocketHints; did you forget to inherit a required module?
[ERROR] [com.me.mygdxgame.GwtDefinition] - Errors in 'com/badlogic/gdx/backends/gwt/emu/com/badlogic/gdx/utils/Array.java'
[ERROR] [com.me.mygdxgame.GwtDefinition] - Line 342: No source code is available for type com.badlogic.gdx.utils.StringBuilder; did you forget to inherit a required module?
[ERROR] [com.me.mygdxgame.GwtDefinition] - Errors in 'com/badlogic/gdx/utils/ObjectMap.java'
[ERROR] [com.me.mygdxgame.GwtDefinition] - Line 468: No source code is available for type com.badlogic.gdx.utils.StringBuilder; did you forget to inherit a required module?
[ERROR] [com.me.mygdxgame.GwtDefinition] - Unable to find type 'com.me.mygdxgame.client.GwtLauncher'
[ERROR] [com.me.mygdxgame.GwtDefinition] - Hint: Previous compiler errors may have made this type unavailable
[ERROR] [com.me.mygdxgame.GwtDefinition] - 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] [com.me.mygdxgame.GwtDefinition] - Failed to load module 'com.me.mygdxgame.GwtDefinition' from user agent 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1' at localhost:56812

目前我使用的是 libgdx 0.9.7 版。我的操作系统是 Ubuntu 12,Eclipse Indigo。请帮帮我。谢谢。

4

2 回答 2

0

我遇到了类似的错误..刚刚将 Libgdx jar 更新为最新的夜间构建版本,问题将得到解决。

于 2013-05-16T07:15:40.413 回答
0

在您的 html 项目的 java 构建路径中添加的 jar 是什么。还要检查您的 html 项目中是否存在 gdx-sources.jar。同样在 java 构建路径中,转到导出选项卡并检查是否检查了所有依赖项。

于 2013-05-16T06:41:42.110 回答