Gradlew:没有可用于“userclass”类型的源代码

时间:2016-08-27 20:32:05

标签: java android android-studio gradle libgdx

我一直在关注使用libgdx http://www.kilobolt.com/zombie-bird-tutorial-flappy-bird-remake.html创建一个flappy bird clone的教程 虽然Android和桌面版本工作正常,但当我尝试创建html版本时,我遇到了麻烦。

我已经阅读了有关反思的libgdx文档,讨论了这个问题https://github.com/libgdx/libgdx/wiki/Reflection但是当我尝试按照提到的内容时,我仍然会收到错误。我还读过大多数关于类似我的问题的其他问题,但我不完全确定我是否正确地实现了他们的问题的解决方案,因为我仍然得到相同的错误。

这是我在运行./gradlew html:dist

时目前获得的
Configuration on demand is an incubating feature.
:html:clean
:html:addSource
:core:compileJava UP-TO-DATE
:core:processResources UP-TO-DATE
:core:classes UP-TO-DATE
:core:jar UP-TO-DATE
:html:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
:html:processResources UP-TO-DATE
:html:compileGwt
Compiling module com.gsoo.wirebird.GdxDefinition
   Validating units:
      [ERROR] Errors in 'file:/home/gavinsu/Documents/wireBird-master/core/src/com/gsoo/wirebird/wbGame.java'
         [ERROR] Line 11: No source code is available for type com.gsoo.wbHelpers.AssetLoader; did you forget to inherit a required module?
         [ERROR] Line 12: No source code is available for type com.gsoo.screens.SplashScreen; did you forget to inherit a required module?
   [ERROR] Aborting compile due to errors in some input files
:html:compileGwt FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':html:compileGwt'.
> Process 'command '/usr/lib/jvm/java-8-oracle/bin/java'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 21.749 secs

我不想让这篇文章太长,所以我会把我的整个代码发布到这里:https://drive.google.com/file/d/0B29c3qREvyioSjlFUVA2MzE3VTA/view?usp=sharing (如果不允许,我会在其中进行编辑。)

我将如何解决这个问题?

感谢您的时间。

1 个答案:

答案 0 :(得分:0)

好吧,第二天早上我能够弄清楚这一点。事实证明我需要将源路径添加到* .gwt.xml中的其他类: <source path="path/to/class" /> 这修复了我的错误并允许它完全编译。