2013-10-18 3 views
8

जब मैं HTML में अपना गेम संकलित करने का प्रयास करता हूं तो मुझे एक अजीब समस्या आ रही है। (मैंने अन्य विषयों की खोज की और वे उन लोगों को संदर्भित करते हैं जो अवैध पैकेज आयात कर रहे हैं, जो मैं नहीं हूं।)प्लेएन/जीडब्ल्यूटी - क्या आप एक आवश्यक मॉड्यूल का उत्तराधिकारी भूल गए थे?

तो मूल रूप से, मेरे मुख्य भाग में और मेरे मुख्य पैकेज के बाहर बुलाया जाने वाला प्रत्येक वर्ग मुझे यह त्रुटि फेंक देता है। ये कक्षाएं मेरे द्वारा लागू की गई हैं और वे कुछ भी अवैध आयात नहीं करते हैं (कोई प्रतिबिंब नहीं, कोई I/O, केवल स्वयं निर्मित वर्ग और jbox2d)। ऐसा लगता है कि यह आयात या उस तरह कुछ अनदेखा कर रहा है।

इसका परीक्षण करने के लिए, मैंने टेस्ट नामक एक खाली कक्षा बनाई। जब यह मेरे मुख्य पैकेज में था, मुझे कोई त्रुटि नहीं मिली, जबकि जब मैंने इसे बाहर ले जाया, तो मुझे मिला:

[INFO] [ERROR] रेखा 73: कोई स्रोत कोड 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? 

उत्तर

15

GWT केवल उप पैकेज में रहने वाले वर्गों को देखता है <source> में gwt.xml फ़ाइल के तत्व सूचीबद्ध हैं।

तो आप प्रत्येक के लिए <source path="navigable"/> जोड़ने के लिए और हर सबपैकेज आप से कक्षाओं लोड करना चाहते हैं

(त्रुटि संदेश, navigable, entity, map, gui, आदि से) देखें http://www.gwtproject.org/doc/latest/DevGuideOrganizingProjects.html#DevGuideModules

+0

बहुत धन्यवाद आपने मेरी समस्या को ठीक किया: डी – Epi

+0

कोई विचार क्या समस्या है [यहां] (http://stackoverflow.com/questions/37365459/no-source-code-is-available-for-type-type -did में आप भूल जाते हैं करने के लिए इनहेरिट एक) की आवश्यकता? – displayname

0

यदि कोई <source> तत्व परिभाषित किया गया है, तो डिफ़ॉल्ट रूप से GWT क्लाइंट पथ में दिखेगा, इसलिए यदि आप अपनी फ़ाइलों को क्लाइंट पैकेज के अंतर्गत ले जाते हैं तो इसे भी काम करना चाहिए।

संबंधित मुद्दे