本文介绍了无法使用libgdx-utils运行html libgdx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! Im使用Intellij / Gradle作为项目。我试图编译我的libgdx游戏,它适用于android和桌面,但不适用于HTML GWT。 > 我刚刚在这里添加了 libgdx-utils 扩展库,这似乎是导致错误的原因: https://bitbucket.org/dermetfan/libgdx-utils/wiki/Dependency%20Instructions 尝试这个gradle命令 ./ gradlew html:dist 时得到的错误是: :html:compileGwt 编译模块com.xx.xx.GdxDefinition 验证单元: [错误]错误'file:/xx/xx/xx/screens/GameScreen.java' [错误]第66行:没有源代码可用于类型net.dermetfan.gdx.graphics.g2d.Box2DSprite;你忘了继承一个必需的模块吗? [错误]因某些输入文件中的错误而中止编译:html:compileGwt失败 失败:构建失败,出现异常。 *出错:任务':html:compileGwt'的执行失败。 >处理'命令'/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/bin/java''以非零退出值1 我的Gradle文件如下所示: buildscript {存储库{ mavenCentral() jcenter()} 依赖项{ classpath'de.richsource.gradle.plugins:gwt-gradle-plugin:0.5' classpath'com.android.tools.build:gradle:0.13+' classpath'org.robovm:robovm-gradle-plugin:1.0.0-alpha-04'} allprojects { apply plugin:eclipse apply plugin:idea version ='1.0' ext { appName ='xxx-xxx' gdxVersion ='1.4.1' roboVMVersion ='1.0.0-alpha-04' box2DLightsVersion ='1.2' ashleyVersion ='1.3.1' aiVersion ='1.4.0'} 存储库{ mavenCentral() maven {urlhttps://oss.sonatype.org/content/repositories/snapshots/} maven {urlhttps://oss.sonatype .org / content / repositories / releases /} } } project(:desktop){ apply plugin:java 依赖关系{编译项目(:core)编译com.badlogicgames.gdx:gdx-backend -lwjgl:$ gdxVersion compile com.badlogicgames.gdx:gdx-platform:$ gdxVersion:natives-desktop compilecom.badlogicgames.gdx:gdx-box2d-platform:$ gdxVersion:natives-desktop $ b { compile project(:core) compilecom.badlogicgames.gdx:gdx-backend-android:$ gdxVersion nativescom.badlogicgames.gdx:gdx-platform:$ gdxVersion:natives-armeabi nat ivescom.badlogicgames.gdx:gdx-platform:$ gdxVersion:natives-armeabi-v7a nativescom.badlogicgames.gdx:gdx-platform:$ gdxVersion:natives-x86 compile com.badlogicgames.gdx:gdx-box2d:$ gdxVersion nativescom.badlogicgames.gdx:gdx-box2d-platform:$ gdxVersion:natives-armeabi nativescom.badlogicgames.gdx: gdx-box2d-platform:$ gdxVersion:natives-armeabi-v7a nativescom.badlogicgames.gdx:gdx-box2d-platform:$ gdxVersion:natives-x86} } 项目(:ios){应用插件:java应用插件:robovm 配置{natives} dependencies { compile project(:core) compileorg.robovm:robovm-rt:$ {roboVMVersion} compileorg.robovm:robovm -cocoatouch:$ {roboVMVersion} compilecom.badlogicgames.gdx:gdx-backend-robovm:$ gdxVersion nativescom.badlogicgames.gdx:gdx-platform:$ gdxVersion:natives -ios nativescom.badlogicgames.gdx:gdx-box2d-platform:$ gdxVersion:natives-ios} project( html){ apply plugin:gwt apply plugin:war dependencies { compile project(:core) compilecom.badlogicgames.gdx:gdx-backend-gwt:$ gdxVersion compilecom.badlogicgames.gdx:gdx:$ gdxVersion:sources compilecom.badlogicgames。 gdx:gdx-backend-gwt:$ gdxVersion:sources compilecom.badlogicgames.gdx:gdx-box2d:$ gdxVersion:sources compilecom.badlogicgames.gdx:gdx-box2d- gwt:$ gdxVersion:来源} 项目(:core){应用插件:java 依赖关系{编译com.badlogicgames.gdx:gdx:$ gdxVersion compilecom.badlogicgames.gdx:gdx-box2d:$ gdxVersion compile'net .dermetfan.libgdx-utils:libgdx-utils:0.7.0-SNAPSHOT' compile'n et.dermetfan.libgdx-utils:libgdx-utils-box2d:0.7.0-SNAPSHOT'// Box2D模块} } tasks.eclipse.doLast {删除.project} 在我的 GdxDefinition.gwt.xml 文件中,我需要添加一些 $ b $ $ p $ < inherits name ='libgdx-utils'$ < inherit>> /> 现在这个错误已经修复,但现在我又有大约10000个类似的错误 编译模块com.xx / xx / .GdxDefinition 验证单元: [错误]'jar:file: /private/var/root/.gradle/caches/modules-2/files-2.1/com.badlogicgames.gdx/gdx-backend-gwt/1.4.1/6a7814ff9cedbe7e7576d9578258fa99939fd092/gdx-backend-gwt-1.4.1-sources。 jar!/com/badlogic/gwtref/gen/ReflectionCacheSourceCreator.java' [错误]第103行:没有源代码可用于java.io.PrintWriter类型;你忘了继承一个必需的模块吗? [错误]第701行:类型Class< capture#6-of?>的方法getAnnotation(Class< Retention>)未定义。 [错误]第707行:方法getCanonicalName()未定义类型Class< capture#7-of?> [错误]第709行:没有源代码可用于java.lang.reflect.Method类型;你忘了继承一个必需的模块吗? [错误]第709行:方法getDeclaredMethods()未定义类型Class< capture#8-of?> [错误]第713行:方法getCanonicalName()未定义类型Class< capture#10-of?> [错误]第716行:方法getCanonicalName()未定义类型Class< capture#12-of?> [错误]第724行:没有源代码可用于类型java.lang.reflect.InvocationTargetException;你忘了继承一个必需的模块吗? [错误]第740行:方法getCanonicalName()未定义类型 [错误]行744:方法getCanonicalName()未定义类型 [错误]行747:类型Class< capture#21-of?>的方法getCanonicalName()未定义。 [错误]第748行:没有源代码可用于java.lang.reflect.Array类型;你忘了继承一个必需的模块吗? [错误]第755行:方法getCanonicalName()未定义类型Class< capture#23-of?> [错误]第786行:方法getCanonicalName()未定义类型Class< capture#33-of?> [错误]'file:/xx/xx/xx/screens/GameScreen.java'中的错误 [错误]第66行:没有源代码可用于net.dermetfan.gdx.graphics类型。 g2d.Box2DSprite;你忘了继承一个必需的模块吗? [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.6.0/8237d1bd37127188107388c8724be44a0e9f73ca/中的错误gwt-user-2.6.0.jar!/com/google/gwt/codegen/rebind/GwtCodeGenContext.java' [错误]第52行:没有源代码可用于java.io.PrintWriter类型;你忘了继承一个必需的模块吗? [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.6.0/8237d1bd37127188107388c8724be44a0e9f73ca/中的错误gwt-user-2.6.0.jar!/com/google/gwt/codegen/server/AbortablePrintWriter.java' [错误]第26行:没有源代码可用于java.io.PrintWriter类型;你忘了继承一个必需的模块吗? [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.6.0/8237d1bd37127188107388c8724be44a0e9f73ca/中的错误gwt-user-2.6.0.jar!/com/google/gwt/codegen/server/LoggingCodeGenContext.java' [错误]第32行:方法getAnonymousLogger()未定义类型Logger [错误]'jar:file:/ private \\ var / root / 2.6.0.jar!/com/google/gwt/codegen/server/SafeHtmlStringGenerator.java' [错误]第29行:方法getCanonicalName()未定义为类Class< SafeHtmlBuilder> [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.6.0/8237d1bd37127188107388c8724be44a0e9f73ca/中的错误gwt-user-2.6.0.jar!/com/google/gwt/codegen/server/SourceWriterBase.java' [错误]第63行:方法格式(字符串,对象[])未定义类型字符串 [错误]第102行:方法格式(字符串,对象[])未定义类型字符串 [错误]第116行:方法格式(字符串,对象[])未定义类型String [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0中的错误/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/DelegatingGeneratorContext.java' [错误]第49行:没有源代码可用于java.io.PrintWriter类型;你忘了继承一个必需的模块吗? [错误]的错误在罐子:文件:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/ gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/GeneratorContext.java' [错误]第45行:没有源代码可用于java.io.PrintWriter类型;你忘了继承一个必需的模块吗? [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/中的错误gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/Linker.java' [错误]第66行:方法isAnnotationPresent(Class< Shardable>)未定义类型Class< ;捕获#1的?扩展Linker> [错误]第71行:方法getDeclaredField(String)未定义类型Class< capture#2-of?扩展Linker> [错误]第73行:没有源代码可用于java.lang.NoSuchFieldException类型;你忘了继承一个必需的模块吗? [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/中的错误gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/ServletContainerLauncher.java' [错误]第117行:没有源代码可用于java.net.BindException类型;你忘了继承一个必需的模块吗? [错误]的错误在罐子:文件:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/ gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/StubGeneratorContext.java' [错误]第40行:没有源代码可用于java.io.PrintWriter类型;你忘了继承一个必需的模块吗? [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/中的错误gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/TreeLogger.java' [错误]第50行:没有源代码可用于java.net.URL类型;你忘了继承一个必需的模块吗? [错误]的错误在罐子:文件:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/ gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/debug/JsoEval.java' [错误]第133行:没有源代码可用于java.lang.reflect类型。的InvocationTargetException;你忘了继承一个必需的模块吗? [错误]第159行:没有源代码可用于java.lang.reflect.Method类型;你忘了继承一个必需的模块吗? [错误]第159行:方法getMethods()未定义类型Class< Object> [错误]第175行:没有源代码可用于java.lang.ClassLoader类型;你忘了继承一个必需的模块吗? [错误]第181行:方法getMethods()未定义类型Class< capture#2-of?> [错误]第181行:方法getMethods()未定义类型 [错误]第298行:方法getClassLoader()未定义类型Class< capture#3-of?扩展对象> [错误]第301行:方法getClassLoader()未定义类型 [错误]第327行:方法forName(字符串,布尔,ClassLoader)未定义为类 [错误]第339行:方法forName(String,boolean,ClassLoader)未定义类型 [错误]第354行:方法getMethods()未定义类型Class< Object> [错误]第372行:方法getMethod(String,Class [])未定义类型 [错误]第392行:方法getMethod(String,Class [])未定义类型类 [错误]第397行:方法forName(字符串,布尔,ClassLoader)未定义为类 [错误]行436:方法isAssignableFrom(Class)未定义类型Class [错误]第447行:方法isAssignableFrom(Class)未定义类型 [错误]第463行:没有源代码可用于类型java.io.PrintWriter;你忘了继承一个必需的模块吗? [错误]第464行:类型Throwable中的方法printStackTrace(PrintStream)不适用于参数(PrintWriter) [错误]'jar:file:/ private / var / root / .gradle /缓存/模块-2 /文件-2.1 / com.google.gwt / GWT-dev /目录2.6.0 / af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802 / GWT-DEV-2.6.0.jar!/ COM /谷歌/ GWT /核心/转/链接器/ Artifact.java' [错误]第49行:类型Class< C>未定义方法cast(Artifact< capture#6-of? [错误]第76行:方法currentThread()未定义为类型Thread [ERROR]第77行:方法asSubclass(Class< Linker>)未定义类型Class< capture#11 -of?> [错误]第99行:方法isAnnotationPresent(Class< Transferable>)对类型Class< capture#14-of?扩展神器> [错误]的错误在罐子:文件:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/ gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/ArtifactSet.java' [错误]第89行:方法isInstance(Artifact< capture#8-of?> ;)对类型< T>未定义; [错误]第90行:类型Class< T>未定义方法cast(Artifact< capture#9 ofof? [错误]的错误在罐子:文件:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/ gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/GeneratedResource.java' [错误]第45行:currentThread()方法未定义为类型Thread [ERROR]第46行:方法asSubclass(Class< Generator>)对类型Class< capture#7-of? [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/中的错误gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/ModuleMetricsArtifact.java' [错误]第36行:没有源代码可用于java.util.concurrent类型。 atomic.AtomicInteger;你忘了继承一个必需的模块吗? [错误]的错误在罐子:文件:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/ gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/SyntheticArtifact.java' [错误]第74行:没有源代码可用于java.io.ObjectInputStream类型;你忘了继承一个必需的模块吗? [错误]第80行:没有源代码可用于java.io.ObjectOutputStream类型;你忘了继承一个必需的模块吗? [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/中的错误gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/impl/JarEntryEmittedArtifact.java' [错误]第37行:没有源代码可用于java.util类型。 jar.JarFile;你忘了继承一个必需的模块吗? [错误]第67行:没有源代码可用于java.util.jar.JarEntry类型;你忘了继承一个必需的模块吗? [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/中的错误gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/impl/ResourceInjectionUtil.java' [错误]第139行:没有源代码可用于java.net类型。网址;你忘了继承一个必需的模块吗? [错误]第143行:没有源代码可用于java.net.MalformedURLException类型;你忘了继承一个必需的模块吗? [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/中的错误gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.j ava' [错误]第560行:没有源代码可用于java.net类型.URL;你忘了继承一个必需的模块吗? [错误]第560行:方法getResource(String)未定义类型Class< SelectionScriptLinker> [错误]第567行:没有源代码可用于java.net.URLConnection类型;你忘了继承一个必需的模块吗? [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/中的错误gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java' [错误]第80行:没有源代码可用于类型java.io. ObjectInputStream的;你忘了继承一个必需的模块吗? [错误]第86行:没有源代码可用于java.io.ObjectOutputStream类型;你忘了继承一个必需的模块吗? [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/中的错误gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/impl/StandardLinkerContext.java' [错误]第143行:方法getAnnotation(Class< LinkerOrder>)未定义对于类型Class< capture#1-of?扩展Linker> [错误]第165行:方法getAnnotation(Class< LinkerOrder>)未定义类型Class< capture#6-of?扩展Linker> [错误]第528行:方法newInstance()未定义类型Class< capture#15-of?扩展Linker> [错误]第529行:没有源代码可用于java.lang.InstantiationException类型;你忘了继承一个必需的模块吗? [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/中的错误gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/impl/StandardSelectionProperty.java' [错误]第76行:方法newInstance()未定义类型Class< ;捕获#4的?扩展PropertyProviderGenerator> [错误]第79行:没有源代码可用于类型java.lang.InstantiationException;你忘了继承一个必需的模块吗? [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/中的错误gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/impl/StandardSymbolData.java' [错误]第49行:方法toURI()未定义为类型File [错误]第52行:没有源代码可用于java.net.URI类型;你忘了继承一个必需的模块吗? [错误]第53行:没有源代码可用于java.net.URISyntaxException类型;你忘了继承一个必需的模块吗? [错误]第158行:没有源代码可用于java.io.ObjectInputStream类型;你忘了继承一个必需的模块吗? [错误]第172行:没有源代码可用于java.io.InvalidObjectException类型;你忘了继承一个必需的模块吗? [错误]第192行:没有源代码可用于java.io.ObjectOutputStream类型;你忘了继承一个必需的模块吗? [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/中的错误gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/soyc/SourceMapRecorder.java' [错误]第53行:没有源代码可用于com.google.gwt类型。 thirdparty.debugging.sourcemap.SourceMapGenerator;你忘了继承一个必需的模块吗? [错误]第53行:没有源代码可用于com.google.gwt.thirdparty.debugging.sourcemap.SourceMapGeneratorFactory类型;你忘了继承一个必需的模块吗? [错误]第53行:没有源代码可用于com.google.gwt.thirdparty.debugging.sourcemap.SourceMapFormat类型;你忘了继承一个必需的模块吗? [错误]第77行:没有源代码可用于com.google.gwt.thirdparty.debugging.sourcemap.FilePosition类型;你忘了继承一个必需的模块吗? [错误]第82行:方法reset()未定义为类型ByteArrayOutputStream [错误]'jar:file:/private/var/root/.gradle/caches/modules-2中的错误/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/soyc/impl/DependencyRecorder.java [错误]第82行:没有源代码可用于类型java.util.zip.GZIPOutputStream;你忘了继承一个必需的模块吗? [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/中的错误gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/soyc/impl/MemberFactory.java' [错误]第77行:没有源代码可用于java.lang类型。 reflect.Constructor< T> ;;你忘了继承一个必需的模块吗? [ERROR]第77行:类Class< V>未定义方法getConstructor(Class< MemberFactory> ;, Class< capture#5 of?super K>) [错误]第85行:没有源代码可用于类型java.lang.InstantiationException;你忘了继承一个必需的模块吗? [错误]第91行:没有源代码可用于类型java.lang.reflect.InvocationTargetException;你忘了继承一个必需的模块吗? [错误]'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/中的错误gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/soyc/impl/SizeMapRecorder.java' [错误]第177行:没有源代码可用于java.util类型。 zip.GZIPOutputStream;你忘了继承一个必需的模块吗? 它就这样继续下去。 GWT需要编译源代码。将它添加到构建脚本中的HTML项目中: compile'net.dermetfan.libgdx-utils:libgdx-utils:0.7 .2:sources' compile'net.dermetfan.libgdx-utils:libgdx-utils-box2d:0.7.2:sources' Im trying to compile my libgdx game, its working for android and desktop, but not HTML GWT.Im using Intellij / Gradle for the project.I just added the libgdx-utils extension lib found here which seems to be causing the error: https://bitbucket.org/dermetfan/libgdx-utils/wiki/Dependency%20InstructionsThe error i get when attempting this gradle command ./gradlew html:dist is::html:compileGwtCompiling module com.xx.xx.GdxDefinition Validating units: [ERROR] Errors in 'file:/xx/xx/xx/screens/GameScreen.java' [ERROR] Line 66: No source code is available for type net.dermetfan.gdx.graphics.g2d.Box2DSprite; did you forget to inherit a required module? [ERROR] Aborting compile due to errors in some input files:html:compileGwt FAILEDFAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':html:compileGwt'.> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1My Gradle file looks like this:buildscript { repositories { mavenCentral() jcenter() } dependencies { classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.5' classpath 'com.android.tools.build:gradle:0.13+' classpath 'org.robovm:robovm-gradle-plugin:1.0.0-alpha-04' }}allprojects { apply plugin: "eclipse" apply plugin: "idea" version = '1.0' ext { appName = 'xxx-xxx' gdxVersion = '1.4.1' roboVMVersion = '1.0.0-alpha-04' box2DLightsVersion = '1.2' ashleyVersion = '1.3.1' aiVersion = '1.4.0' } repositories { mavenCentral() maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } maven { url "https://oss.sonatype.org/content/repositories/releases/" } }}project(":desktop") { apply plugin: "java" dependencies { compile project(":core") compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion" compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop" }}project(":android") { apply plugin: "android" configurations { natives } dependencies { compile project(":core") compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion" natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi" natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a" natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86" compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion" natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi" natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a" natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86" }}project(":ios") { apply plugin: "java" apply plugin: "robovm" configurations { natives } dependencies { compile project(":core") compile "org.robovm:robovm-rt:${roboVMVersion}" compile "org.robovm:robovm-cocoatouch:${roboVMVersion}" compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion" natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios" natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios" }}project(":html") { apply plugin: "gwt" apply plugin: "war" dependencies { compile project(":core") compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion" compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources" compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources" compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion:sources" compile "com.badlogicgames.gdx:gdx-box2d-gwt:$gdxVersion:sources" }}project(":core") { apply plugin: "java" dependencies { compile "com.badlogicgames.gdx:gdx:$gdxVersion" compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion" compile 'net.dermetfan.libgdx-utils:libgdx-utils:0.7.0-SNAPSHOT' compile 'net.dermetfan.libgdx-utils:libgdx-utils-box2d:0.7.0-SNAPSHOT' // Box2D module }}tasks.eclipse.doLast { delete ".project"}Ive made some progressIn my GdxDefinition.gwt.xml file i needed to add some <inheritis> tags:<inherits name='libgdx-utils' /><inherits name='libgdx-utils-box2d' />That error is now fixed but now i have about 10000 more errors that are similarCompiling module com.xx/xx/.GdxDefinition Validating units: [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.badlogicgames.gdx/gdx-backend-gwt/1.4.1/6a7814ff9cedbe7e7576d9578258fa99939fd092/gdx-backend-gwt-1.4.1-sources.jar!/com/badlogic/gwtref/gen/ReflectionCacheSourceCreator.java' [ERROR] Line 103: No source code is available for type java.io.PrintWriter; did you forget to inherit a required module? [ERROR] Line 701: The method getAnnotation(Class<Retention>) is undefined for the type Class<capture#6-of ?> [ERROR] Line 707: The method getCanonicalName() is undefined for the type Class<capture#7-of ?> [ERROR] Line 709: No source code is available for type java.lang.reflect.Method; did you forget to inherit a required module? [ERROR] Line 709: The method getDeclaredMethods() is undefined for the type Class<capture#8-of ?> [ERROR] Line 713: The method getCanonicalName() is undefined for the type Class<capture#10-of ?> [ERROR] Line 716: The method getCanonicalName() is undefined for the type Class<capture#12-of ?> [ERROR] Line 724: No source code is available for type java.lang.reflect.InvocationTargetException; did you forget to inherit a required module? [ERROR] Line 740: The method getCanonicalName() is undefined for the type Class [ERROR] Line 744: The method getCanonicalName() is undefined for the type Class [ERROR] Line 747: The method getCanonicalName() is undefined for the type Class<capture#21-of ?> [ERROR] Line 748: No source code is available for type java.lang.reflect.Array; did you forget to inherit a required module? [ERROR] Line 755: The method getCanonicalName() is undefined for the type Class<capture#23-of ?> [ERROR] Line 786: The method getCanonicalName() is undefined for the type Class<capture#33-of ?> [ERROR] Errors in 'file:/xx/xx/xx/screens/GameScreen.java' [ERROR] Line 66: No source code is available for type net.dermetfan.gdx.graphics.g2d.Box2DSprite; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.6.0/8237d1bd37127188107388c8724be44a0e9f73ca/gwt-user-2.6.0.jar!/com/google/gwt/codegen/rebind/GwtCodeGenContext.java' [ERROR] Line 52: No source code is available for type java.io.PrintWriter; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.6.0/8237d1bd37127188107388c8724be44a0e9f73ca/gwt-user-2.6.0.jar!/com/google/gwt/codegen/server/AbortablePrintWriter.java' [ERROR] Line 26: No source code is available for type java.io.PrintWriter; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.6.0/8237d1bd37127188107388c8724be44a0e9f73ca/gwt-user-2.6.0.jar!/com/google/gwt/codegen/server/LoggingCodeGenContext.java' [ERROR] Line 32: The method getAnonymousLogger() is undefined for the type Logger [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.6.0/8237d1bd37127188107388c8724be44a0e9f73ca/gwt-user-2.6.0.jar!/com/google/gwt/codegen/server/SafeHtmlStringGenerator.java' [ERROR] Line 29: The method getCanonicalName() is undefined for the type Class<SafeHtmlBuilder> [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.6.0/8237d1bd37127188107388c8724be44a0e9f73ca/gwt-user-2.6.0.jar!/com/google/gwt/codegen/server/SourceWriterBase.java' [ERROR] Line 63: The method format(String, Object[]) is undefined for the type String [ERROR] Line 102: The method format(String, Object[]) is undefined for the type String [ERROR] Line 116: The method format(String, Object[]) is undefined for the type String [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/DelegatingGeneratorContext.java' [ERROR] Line 49: No source code is available for type java.io.PrintWriter; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/GeneratorContext.java' [ERROR] Line 45: No source code is available for type java.io.PrintWriter; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/Linker.java' [ERROR] Line 66: The method isAnnotationPresent(Class<Shardable>) is undefined for the type Class<capture#1-of ? extends Linker> [ERROR] Line 71: The method getDeclaredField(String) is undefined for the type Class<capture#2-of ? extends Linker> [ERROR] Line 73: No source code is available for type java.lang.NoSuchFieldException; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/ServletContainerLauncher.java' [ERROR] Line 117: No source code is available for type java.net.BindException; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/StubGeneratorContext.java' [ERROR] Line 40: No source code is available for type java.io.PrintWriter; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/TreeLogger.java' [ERROR] Line 50: No source code is available for type java.net.URL; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/debug/JsoEval.java' [ERROR] Line 133: No source code is available for type java.lang.reflect.InvocationTargetException; did you forget to inherit a required module? [ERROR] Line 159: No source code is available for type java.lang.reflect.Method; did you forget to inherit a required module? [ERROR] Line 159: The method getMethods() is undefined for the type Class<Object> [ERROR] Line 175: No source code is available for type java.lang.ClassLoader; did you forget to inherit a required module? [ERROR] Line 181: The method getMethods() is undefined for the type Class<capture#2-of ?> [ERROR] Line 181: The method getMethods() is undefined for the type Class [ERROR] Line 298: The method getClassLoader() is undefined for the type Class<capture#3-of ? extends Object> [ERROR] Line 301: The method getClassLoader() is undefined for the type Class [ERROR] Line 327: The method forName(String, boolean, ClassLoader) is undefined for the type Class [ERROR] Line 339: The method forName(String, boolean, ClassLoader) is undefined for the type Class [ERROR] Line 354: The method getMethods() is undefined for the type Class<Object> [ERROR] Line 372: The method getMethod(String, Class[]) is undefined for the type Class [ERROR] Line 392: The method getMethod(String, Class[]) is undefined for the type Class [ERROR] Line 397: The method forName(String, boolean, ClassLoader) is undefined for the type Class [ERROR] Line 436: The method isAssignableFrom(Class) is undefined for the type Class [ERROR] Line 447: The method isAssignableFrom(Class) is undefined for the type Class [ERROR] Line 463: No source code is available for type java.io.PrintWriter; did you forget to inherit a required module? [ERROR] Line 464: The method printStackTrace(PrintStream) in the type Throwable is not applicable for the arguments (PrintWriter) [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/Artifact.java' [ERROR] Line 49: The method cast(Artifact<capture#6-of ?>) is undefined for the type Class<C> [ERROR] Line 76: The method currentThread() is undefined for the type Thread [ERROR] Line 77: The method asSubclass(Class<Linker>) is undefined for the type Class<capture#11-of ?> [ERROR] Line 99: The method isAnnotationPresent(Class<Transferable>) is undefined for the type Class<capture#14-of ? extends Artifact> [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/ArtifactSet.java' [ERROR] Line 89: The method isInstance(Artifact<capture#8-of ?>) is undefined for the type Class<T> [ERROR] Line 90: The method cast(Artifact<capture#9-of ?>) is undefined for the type Class<T> [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/GeneratedResource.java' [ERROR] Line 45: The method currentThread() is undefined for the type Thread [ERROR] Line 46: The method asSubclass(Class<Generator>) is undefined for the type Class<capture#7-of ?> [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/ModuleMetricsArtifact.java' [ERROR] Line 36: No source code is available for type java.util.concurrent.atomic.AtomicInteger; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/SyntheticArtifact.java' [ERROR] Line 74: No source code is available for type java.io.ObjectInputStream; did you forget to inherit a required module? [ERROR] Line 80: No source code is available for type java.io.ObjectOutputStream; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/impl/JarEntryEmittedArtifact.java' [ERROR] Line 37: No source code is available for type java.util.jar.JarFile; did you forget to inherit a required module? [ERROR] Line 67: No source code is available for type java.util.jar.JarEntry; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/impl/ResourceInjectionUtil.java' [ERROR] Line 139: No source code is available for type java.net.URL; did you forget to inherit a required module? [ERROR] Line 143: No source code is available for type java.net.MalformedURLException; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/impl/SelectionScriptLinker.j ava' [ERROR] Line 560: No source code is available for type java.net.URL; did you forget to inherit a required module? [ERROR] Line 560: The method getResource(String) is undefined for the type Class<SelectionScriptLinker> [ERROR] Line 567: No source code is available for type java.net.URLConnection; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/impl/StandardGeneratedResource.java' [ERROR] Line 80: No source code is available for type java.io.ObjectInputStream; did you forget to inherit a required module? [ERROR] Line 86: No source code is available for type java.io.ObjectOutputStream; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/impl/StandardLinkerContext.java' [ERROR] Line 143: The method getAnnotation(Class<LinkerOrder>) is undefined for the type Class<capture#1-of ? extends Linker> [ERROR] Line 165: The method getAnnotation(Class<LinkerOrder>) is undefined for the type Class<capture#6-of ? extends Linker> [ERROR] Line 528: The method newInstance() is undefined for the type Class<capture#15-of ? extends Linker> [ERROR] Line 529: No source code is available for type java.lang.InstantiationException; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/impl/StandardSelectionProperty.java' [ERROR] Line 76: The method newInstance() is undefined for the type Class<capture#4-of ? extends PropertyProviderGenerator> [ERROR] Line 79: No source code is available for type java.lang.InstantiationException; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/linker/impl/StandardSymbolData.java' [ERROR] Line 49: The method toURI() is undefined for the type File [ERROR] Line 52: No source code is available for type java.net.URI; did you forget to inherit a required module? [ERROR] Line 53: No source code is available for type java.net.URISyntaxException; did you forget to inherit a required module? [ERROR] Line 158: No source code is available for type java.io.ObjectInputStream; did you forget to inherit a required module? [ERROR] Line 172: No source code is available for type java.io.InvalidObjectException; did you forget to inherit a required module? [ERROR] Line 192: No source code is available for type java.io.ObjectOutputStream; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/soyc/SourceMapRecorder.java' [ERROR] Line 53: No source code is available for type com.google.gwt.thirdparty.debugging.sourcemap.SourceMapGenerator; did you forget to inherit a required module? [ERROR] Line 53: No source code is available for type com.google.gwt.thirdparty.debugging.sourcemap.SourceMapGeneratorFactory; did you forget to inherit a required module? [ERROR] Line 53: No source code is available for type com.google.gwt.thirdparty.debugging.sourcemap.SourceMapFormat; did you forget to inherit a required module? [ERROR] Line 77: No source code is available for type com.google.gwt.thirdparty.debugging.sourcemap.FilePosition; did you forget to inherit a required module? [ERROR] Line 82: The method reset() is undefined for the type ByteArrayOutputStream [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/soyc/impl/DependencyRecorder.java' [ERROR] Line 82: No source code is available for type java.util.zip.GZIPOutputStream; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/soyc/impl/MemberFactory.java' [ERROR] Line 77: No source code is available for type java.lang.reflect.Constructor<T>; did you forget to inherit a required module? [ERROR] Line 77: The method getConstructor(Class<MemberFactory>, Class<capture#5-of ? super K>) is undefined for the type Class<V> [ERROR] Line 85: No source code is available for type java.lang.InstantiationException; did you forget to inherit a required module? [ERROR] Line 91: No source code is available for type java.lang.reflect.InvocationTargetException; did you forget to inherit a required module? [ERROR] Errors in 'jar:file:/private/var/root/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-dev/2.6.0/af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802/gwt-dev-2.6.0.jar!/com/google/gwt/core/ext/soyc/impl/SizeMapRecorder.java' [ERROR] Line 177: No source code is available for type java.util.zip.GZIPOutputStream; did you forget to inherit a required module?And it just goes on and on like this.. 解决方案 GWT needs the source code to compile. Add this to the HTML project in your build script:compile 'net.dermetfan.libgdx-utils:libgdx-utils:0.7.2:sources'compile 'net.dermetfan.libgdx-utils:libgdx-utils-box2d:0.7.2:sources' 这篇关于无法使用libgdx-utils运行html libgdx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-05 16:00