Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to run HTML5 project that was config with gdx-setup.jar v1.12.1 #7323

Closed
1 of 6 tasks
8Observer8 opened this issue Jan 19, 2024 · 3 comments
Closed
1 of 6 tasks

Comments

@8Observer8
Copy link

8Observer8 commented Jan 19, 2024

Issue details

When I try to run HTML5 project with gradlew html:dist I have the next BUILD FAILED (see the log below). The temporary solution is to use gdx-liftoff.jar (releases) instead. But gdx-liftoff.jar requires to use the next commands:

  • HTML5: gradlew html:dist
  • Desktop: gradlew lwjgl3:run and gradlew lwjgl3:jar (to build a standalone executable file)
  • Android: gradlew android:installDebug (to install on real device connected with USB-cable or on running Android emulator (gradlew android:assembleDebug (to create a debug APK), gradlew android:assembleRelease (to create a release APK))

Instead of:

  • HTML5: gradlew html:dist
  • Desktop: gradlew desktop:run and gradlew desktop:jar (to build a standalone executable file)
  • Android: gradlew android:installDebug (gradlew android:assembleDebug, gradlew android:assembleRelease)

At least gdx-liftoff v1.12.1.4 works for HTML5.

Reproduction steps/code

image

  • Go to the created folder, open CMD in this folder and pasta this command: gradlew html:dist
  • You will see a log below

Version of libGDX and/or relevant dependencies

  • gdx-setup.jar v1.12.1
  • Windows 10
  • Chrome 120.0.6099.217 (Official Build) (64-bit)

Log

E:\_Projects\libGDX\My GDX Game>gradlew html:dist
Starting a Gradle Daemon (subsequent builds will be faster)

> Task :html:compileGwt
Compiling module com.mygdx.game.GdxDefinition
   [WARN] Warnings in 'jar:file:/C:/Users/8Observer8/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.8.2/a2b9be2c996a658c4e009ba652a9c6a81c88a797/gwt-user-2.8.2.jar!/com/google/gwt/user/client/ui/impl/RichTextAreaImplIE8toIE10.java'
      [WARN] Line 45: Referencing deprecated class 'com.google.gwt.user.client.ui.impl.RichTextAreaImplStandard'
      [WARN] Line 47: Referencing deprecated class 'com.google.gwt.user.client.ui.impl.RichTextAreaImplStandard'
      [WARN] Line 68: Referencing deprecated class 'com.google.gwt.user.client.ui.impl.RichTextAreaImplStandard'
   Tracing compile failure path for type 'javaemul.internal.StringHashCache'
      [ERROR] Errors in 'jar:file:/C:/Users/8Observer8/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.8.2/a2b9be2c996a658c4e009ba652a9c6a81c88a797/gwt-user-2.8.2.jar!/com/google/gwt/emul/javaemul/internal/StringHashCache.java'
         [ERROR] Line 57: The method setProperty(Object, String, double) is undefined for the type JsUtils
   [ERROR] Aborting compile due to errors in some input files
[ERROR] Error saving compilation unit to cache file: E:\_Projects\libGDX\My GDX Game\html\build\gwt\cache\gwt-unitCache\gwt-unitCache-7b9fbb59f8661539c34f46974ce5fb573aac79fc-C90BB3B791D3293DB8D5BA1AB0A974D4-0000018D2192A685
java.io.IOException: Stream Closed
        at java.base/java.io.RandomAccessFile.readBytes(Native Method)
        at java.base/java.io.RandomAccessFile.read(RandomAccessFile.java:405)
        at com.google.gwt.dev.util.DiskCache.transferToStream(DiskCache.java:170)
        at com.google.gwt.dev.util.DiskCacheToken.writeObject(DiskCacheToken.java:73)
        at jdk.internal.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at java.base/java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1074)
        at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1526)
        at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1448)
        at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1191)
        at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1582)
        at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1539)
        at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1448)
        at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1191)
        at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:354)
        at java.base/java.util.ArrayList.writeObject(ArrayList.java:866)
        at java.base/jdk.internal.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at java.base/java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1074)
        at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1526)
        at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1448)
        at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1191)
        at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:354)
        at com.google.gwt.dev.javac.CachedCompilationUnit.writeObject(CachedCompilationUnit.java:231)
        at jdk.internal.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at java.base/java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1074)
        at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1526)
        at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1448)
        at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1191)
        at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:354)
        at com.google.gwt.dev.javac.PersistentUnitCacheDir$OpenFile.writeUnit(PersistentUnitCacheDir.java:373)
        at com.google.gwt.dev.javac.PersistentUnitCacheDir.writeUnit(PersistentUnitCacheDir.java:194)
        at com.google.gwt.dev.javac.PersistentUnitCache$BackgroundService$6.run(PersistentUnitCache.java:444)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:842)

> Task :html:compileGwt FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':html:compileGwt'.
> Process 'command 'E:\Program Files\Java\jdk-17\bin\java.exe'' 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.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 1m 31s
5 actionable tasks: 5 executed

Please select the affected platforms

  • Android
  • iOS
  • HTML/GWT
  • Windows
  • Linux
  • macOS
@Frosty-J
Copy link
Contributor

Duplicate of #7283. Setting gdxVersion to 1.12.2-SNAPSHOT looks like a workaround, but really I don't think #7250 should have been merged so long before a release if breaking the current stable version was necessary.

@8Observer8
Copy link
Author

8Observer8 commented Jan 19, 2024

Thank you very much! Yes, this works:

build.gradle

allprojects {
    apply plugin: "eclipse"

    version = '1.0'
    ext {
        appName = "My GDX Game"
        gdxVersion = '1.12.2-SNAPSHOT'

I closed the issue and subscribed on #7283.

@tommyettinger
Copy link
Member

Duplicate of #7283. Setting gdxVersion to 1.12.2-SNAPSHOT looks like a workaround, but really I don't think #7250 should have been merged so long before a release if breaking the current stable version was necessary.

As I have been saying for literally 3 years, if gdx-setup just versioned releases instead of posting a nightly build willy-nilly, this wouldn't be an issue. No one has listened to me, or at least done something. So, I did something, and made gdx-liftoff, which uses versioned releases. If gdx-setup makes projects that expect things from the nightly build of libGDX, it should just depend on the nightly build of libGDX, which would break constantly and that should be expected of the bleeding edge. OR, for projects that actually value stability, gdx-setup should have an identifiable version and use a specific stable version of libGDX, potentially with past downloads of gdx-setup still available. Like gdx-liftoff does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants