gpt4 book ai didi

android - LibGdx 和 Gwt : No source code is available for type

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:20:16 25 4
gpt4 key购买 nike

我正在尝试开始我的 Html 项目,但我遇到了一些问题。桌面和 Android 项目运行良好。问题是我有一个其他项目用作未导入的库或其他东西。

[ERROR] [com.mobilecostudios.walkingskeleton.GwtDefinition] - Errors in 'file:/C:/Users/chelo/Documents/mobilecostudios-libgdx/trunk/walkingskeleton/WalkingSkeleton/src/com/mobilecostudios/walkingskeleton/GameLoop.java'
[ERROR] [com.mobilecostudios.walkingskeleton.GwtDefinition] - Line 21: No source code is available for type com.mobilecostudios.gamelibrary.Domain.BaseSprite; did you forget to inherit a required module?

我的项目层次结构是:

  • 游戏开发库
  • 行走的骨架
  • WalkingSkeleton-html

我的 gwt.xml 是:

    <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd">
<module>
<inherits name='com.badlogic.gdx.backends.gdx_backends_gwt' />
<inherits name='GameLoop' />
<entry-point class='com.mobilecostudios.walkingskeleton.client.GwtLauncher' />
<set-configuration-property name="gdx.assetpath" value="../WalkingSkeleton-android/assets" />
</module>

我已经将项目添加到构建路径中。我还缺少什么?

构建路径 enter image description here

最佳答案

您必须确保还将项目的源代码添加到您的路径中。将在客户端使用的任何 GWT Java 模块都需要提供其源代码。

在你的情况下,

<inherits name='GameLoop' />

应该是:

<inherits name='com.mobilecostudios.walkingskeleton.GameLoop' />

此外,com.mobilecostudios.gamelibrary.Domain.BaseSprite 在哪里?来自?如果它在客户端使用,则需要将其添加到模块 .gwt.xml文件。应该是这样的:

<inherits name='com.mobilecostudios.gamelibrary.GameLibrary' />

以上,我假设 GameLibrary.gwt.xml是包含 com.mobilecostudios.gamelibrary.Domain.BaseSprite 的项目的 GWT 模块 XML 文件.

基本上,当您想在客户端的自己的项目中使用外部 GWT 模块时,您需要通过将源代码和二进制文件添加到您的构建路径来将其导入到您的项目中,并且您还需要添加一个 <inherits name='...'>。给你的.gwt.xml您的项目文件。

关于android - LibGdx 和 Gwt : No source code is available for type,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16004588/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com