Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/351.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 将libgdx项目导出为HTML-您是否忘记继承所需的模块?_Java_Gwt_Reflection_Libgdx - Fatal编程技术网

Java 将libgdx项目导出为HTML-您是否忘记继承所需的模块?

Java 将libgdx项目导出为HTML-您是否忘记继承所需的模块?,java,gwt,reflection,libgdx,Java,Gwt,Reflection,Libgdx,我尝试用HTML导出我的libgdx游戏。我已经在Android和桌面上导出了它,而且运行良好。但是当我执行/gradlew html:dist时,我有很多类似这样的错误: [ERROR] Line 75: No source code is available for type net.spookygames.gdx.gameservices.playtomic.PlaytomicServicesHandler; did you forget to inherit a required mod

我尝试用HTML导出我的libgdx游戏。我已经在Android和桌面上导出了它,而且运行良好。但是当我执行
/gradlew html:dist
时,我有很多类似这样的错误:

[ERROR] Line 75: No source code is available for type net.spookygames.gdx.gameservices.playtomic.PlaytomicServicesHandler; did you forget to inherit a required module?
net.spookygames.gdx.gameservices是一个包,位于核心文件夹中我的主包旁边:

通过将这一行放在html文件夹中的GdxDefinition.gwt.xml中,我发现我需要使用反射:

<extend-configuration-property name="gdx.reflect.include" value="net.spookygames.gdx.gameservices" />

这里的问题不是由于反射,我认为您忘记了继承外部包名
net.spookygames.gdx.gameservices

您可以按照以下步骤操作:

  • 创建与其他
    .gwt.xml
    并行的
    PlaytomicServicesHandler.gwt.xml
    ,您将在核心模块中找到

  • PlaytomicServicesHandler.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>
        <source path="net/spookygames/gdx/gameservices" />
    </module>
    
    
    
  • 打开
    GdxDefinition.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>
        <source path="net/spookygames/gdx/gameservices" />
    </module>
    
    在模块标签内放置此条目


  • 希望这能解决您的问题。

    这里的问题不是由于反射,我认为您忘记了继承外部包名
    net.spookygames.gdx.gameservices

    您可以按照以下步骤操作:

  • 创建与其他
    .gwt.xml
    并行的
    PlaytomicServicesHandler.gwt.xml
    ,您将在核心模块中找到

  • PlaytomicServicesHandler.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>
        <source path="net/spookygames/gdx/gameservices" />
    </module>
    
    
    
  • 打开
    GdxDefinition.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>
        <source path="net/spookygames/gdx/gameservices" />
    </module>
    
    在模块标签内放置此条目


  • 希望这能解决你的问题。

    好吧,哈哈,你的答案是正确的,但是在路径中,你在每个文件夹之间都放了点,而不是“/”。谢谢我的错误,这是由于复制粘贴的包,我会更新我的答案,当我回到家。因为我看到你是相当强大的gwt和libgdx,你可以看看我的新问题?()谢谢好的,哈哈,你的答案是正确的,但是在路径中,你在每个文件夹之间放了点,而不是“/”。谢谢我的错误,这是由于复制粘贴的包,我会更新我的答案,当我回到家。因为我看到你是相当强大的gwt和libgdx,你可以看看我的新问题?谢谢