Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PlayN/GWT - did you forget to inherit a required module?

Tags:

java

html

gwt

playn

I'm having a weird problem when I try to compile my game in HTML. (I searched the other topics and they refer to people who are importing illegal packages, which I'm not.)

So basically, every class called in my main one and outside of my main package throw me this error. These classes are all implemented by me and they dont import anything illegal (no reflection, no I/O, just selfmade classes and jbox2d). It seems like it's ignoring the import or something like that.

To test this, I created an empty class called Test. when it was in my main package I didn't get any error, while when I moved it outside, I got:

[INFO] [ERROR] Line 73: No source code is available for type progetto.saga.map.Test ; did you forget to inherit a required module?

at line 73, I just do Test test = new Test()

this is my .gwt.xml file:

<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>

do you guys have any idea?

Edit: this is the error I get (I get it for every custom class in my main class outside of my main package)

[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?
like image 435
Epi Avatar asked Oct 18 '13 00:10

Epi


1 Answers

GWT only sees the classes living into the sub-packages listed in <source> elements of your gwt.xml file.

So you have to add <source path="navigable"/> for each and every subpackage you want to load classes from (from the error messages, navigable, entity, map, gui, etc.)

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

like image 131
Thomas Broyer Avatar answered Nov 15 '22 17:11

Thomas Broyer