Libgdx HTML项目没有编译(没有可用的源代码......)

时间:2016-07-23 20:55:14

标签: javascript java gwt libgdx

我第一次尝试使用libgdx项目的HTML版本而且我在编译项目时遇到了问题。 compileGwt任务失败了:

[ERROR] Line 21: No source code is available for type de.tomgrill.gdxfacebook.core.GDXFacebook; did you forget to inherit a required module?
[ERROR] Line 30: No source code is available for type io.netty.channel. socket.SocketChannel; did you forget to inherit a required module?

对于各种类,会加载更多相同类型的错误。我的问题是:是否可以让Netty和gdx-facebook扩展在项目的HTML版本中工作?如果是这样,怎么办呢?请注意,除了外行人的“它将java转换为javascript代码”之外,我对GWT一无所知。有关更多信息,请询问。 感谢

编辑:从html项目附加.iml文件

<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":html" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="portablefun" external.system.module.version="1.1" type="JAVA_MODULE" version="4">
  <component name="FacetManager">
    <facet type="android-gradle" name="Android-Gradle">
      <configuration>
        <option name="GRADLE_PROJECT_PATH" value=":html" />
      </configuration>
    </facet>
    <facet type="java-gradle" name="Java-Gradle">
      <configuration>
        <option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
        <option name="BUILDABLE" value="true" />
      </configuration>
    </facet>
  </component>
  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
    <output url="file://$MODULE_DIR$/build/classes/main" />
    <output-test url="file://$MODULE_DIR$/build/classes/test" />
    <exclude-output />
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
      <excludeFolder url="file://$MODULE_DIR$/.gradle" />
      <excludeFolder url="file://$MODULE_DIR$/build" />
    </content>
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="module" module-name="core" exported="" />
    <orderEntry type="library" exported="" name="gdx-backend-gwt-1.9.3" level="project" />
    <orderEntry type="library" exported="" name="gdx-backend-gwt-1.9.3-sources" level="project" />
    <orderEntry type="library" exported="" name="gdx-1.9.3-sources" level="project" />
    <orderEntry type="library" exported="" name="gdx-1.9.3" level="project" />
    <orderEntry type="library" exported="" name="gdx-box2d-1.9.3-sources" level="project" />
    <orderEntry type="library" exported="" name="gdx-box2d-gwt-1.9.3-sources" level="project" />
    <orderEntry type="library" exported="" name="json-20160212" level="project" />
    <orderEntry type="library" exported="" name="gwt-user-2.6.1" level="project" />
    <orderEntry type="library" exported="" name="gdx-box2d-1.9.3" level="project" />
    <orderEntry type="library" exported="" name="validation-api-1.0.0.GA" level="project" />
    <orderEntry type="library" exported="" name="validation-api-1.0.0.GA-sources" level="project" />
    <orderEntry type="library" exported="" scope="RUNTIME" name="gwt-servlet-2.6.0" level="project" />
  </component>
</module>

1 个答案:

答案 0 :(得分:0)

GWT将Java编译为Javascript,但只编译使用GWT自己的类模拟或编写的Java类。我认为您需要在模块描述符中继承它:

<inherits name = "src.de.tomgrill.gdxfacebook.GdxFacebookCore">