【问题标题】:PlayN/GWT - did you forget to inherit a required module?PlayN/GWT - 您是否忘记继承所需的模块?
【发布时间】:2016-05-08 08:27:15
【问题描述】:

当我尝试用 HTML 编译我的游戏时遇到了一个奇怪的问题。 (我搜索了其他主题,他们指的是进口非法包裹的人,我不是。)

所以基本上,在我的主包和主包之外调用的每个类都会给我这个错误。这些类都是由我实现的,它们不会导入任何非法的东西(没有反射,没有 I/O,只有自制的类和 jbox2d)。似乎它忽略了导入或类似的东西。

为了对此进行测试,我创建了一个名为 Test 的空类。当它在我的主包中时,我没有收到任何错误,而当我将它移到外面时,我得到了:

[INFO] [ERROR] Line 73: No source code is available for type progetto.saga.map.Test ;你忘了继承一个必需的模块吗?

在第 73 行,我只做Test test = new Test()

这是我的 .gwt.xml 文件:

<module rename-to='theknowledgetower'>
  <inherits name='playn.PlayN'/>
  <inherits name='TheKnowledgeTowersAssets'/>

  <source path='core'/>
  <source path='html'/>

  <public path="resources" />

  <entry-point class='progetto.saga.html.TheKnowledgeTowersHtml'/>
</module>

你们有什么想法吗?

编辑:这是我得到的错误(我在主包之外的主类中的每个自定义类都得到它)

[INFO]       [ERROR] Line 53: No source code is available for type progetto.saga.navigable.Navigable; did you forget to inherit a required module?
[INFO]       [ERROR] Line 59: No source code is available for type progetto.saga.entity.dynamicentity.Player; did you forget to inherit a required module?
[INFO]       [ERROR] Line 110: No source code is available for type progetto.saga.navigable.button.Button; did you forget to inherit a required module?
[INFO]       [ERROR] Line 114: No source code is available for type progetto.saga.navigable.menu.HomeMenu; did you forget to inherit a required module?
[INFO]       [ERROR] Line 115: No source code is available for type progetto.saga.navigable.GameLoop; did you forget to inherit a required module?
[INFO]       [ERROR] Line 116: No source code is available for type progetto.saga.navigable.menu.CreationMenu; did you forget to inherit a required module?
[INFO]       [ERROR] Line 117: No source code is available for type progetto.saga.navigable.LoadingScreen; did you forget to inherit a required module?
[INFO]       [ERROR] Line 152: No source code is available for type progetto.saga.navigable.menu.GameMenu; did you forget to inherit a required module?
[INFO]       [ERROR] Line 153: No source code is available for type progetto.saga.map.cell.TowerFloor; did you forget to inherit a required module?
[INFO]       [ERROR] Line 154: No source code is available for type progetto.saga.map.cell.TowerWall; did you forget to inherit a required module?
[INFO]       [ERROR] Line 155: No source code is available for type progetto.saga.map.cell.TowerDecoration; did you forget to inherit a required module?
[INFO]       [ERROR] Line 156: No source code is available for type progetto.saga.entity.dynamicentity.enemy.Enemy; did you forget to inherit a required module?
[INFO]       [ERROR] Line 157: No source code is available for type progetto.saga.gui.Bar; did you forget to inherit a required module?
[INFO]       [ERROR] Line 158: No source code is available for type progetto.saga.entity.dynamicentity.equip.Equip; did you forget to inherit a required module?
[INFO]       [ERROR] Line 159: No source code is available for type progetto.saga.entity.dynamicentity.equip.Shield; did you forget to inherit a required module?
[INFO]       [ERROR] Line 160: No source code is available for type progetto.saga.entity.dynamicentity.spell.Spell; did you forget to inherit a required module?
[INFO]       [ERROR] Line 161: No source code is available for type progetto.saga.entity.staticentity.StorableDrop; did you forget to inherit a required module?
[INFO]       [ERROR] Line 162: No source code is available for type progetto.saga.entity.staticentity.Item; did you forget to inherit a required module?

【问题讨论】:

    标签: java html gwt playn


    【解决方案1】:

    GWT 仅看到在您的gwt.xml 文件的&lt;source&gt; 元素中列出的子包中的类。

    因此,您必须为要从中加载类的每个子包添加 &lt;source path="navigable"/&gt;(来自错误消息,navigableentitymapgui 等)

    http://www.gwtproject.org/doc/latest/DevGuideOrganizingProjects.html#DevGuideModules

    【讨论】:

      【解决方案2】:

      如果没有定义 &lt;source&gt; 元素,则默认情况下 GWT 将查看客户端路径,因此如果您将文件移动到客户端包下,它应该也可以工作。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-05-04
        • 1970-01-01
        • 2012-09-02
        • 1970-01-01
        相关资源
        最近更新 更多