LibGDX 1.9.5 上的 GWT (2.8.0) 字体文件解析错误

Font file parsing error with GWT (2.8.0) on LibGDX 1.9.5

我想知道我是否做错了什么,或者我是否偶然发现了 LibGDX/GWT 中的错误。我有一个带有 desktop/Android/iOS/HTML 后端的游戏,大约一个月前从 1.9.5-SNAPSHOT 升级到 1.9.5 导致 HTML 构建停止工作。我能看到的主要变化是从 2.6.0 升级到 GWT 2.8.0。

当我在浏览器中 运行 我的应用程序时(Chrome 56.0.2924.21 beta(64 位)在 Windows 10 上),我收到以下错误:

GwtApplication: exception: com.badlogic.gdx.utils.SerializationException: Error reading file: static/uiskin_hd.json
com.badlogic.gdx.utils.SerializationException: Error reading file: static/uiskin_hd.json
Error reading file: static/uiskin_hd.json
Error reading file: static/uiskin_hd.json
Error loading bitmap font: static/helsinki28plain_hd.fnt
Error loading font file: static/helsinki28plain_hd.fnt
Invalid page id: 
For input string: ""

该字体之前一直有效,我对任何字体都得到了相同的结果,包括来自 LibGDX 测试的 default.fnt。字体文件的顶部如下所示:

info face="Helsinki" size=56 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=2,2,8,4 spacing=0,0
common lineHeight=75 base=52 scaleW=512 scaleH=1024 pages=1 packed=0
page id=0 file="helsinki28plain_hd.png"
chars count=141
char id=32   x=0     y=0     width=0     height=0     xoffset=0     yoffset=52    xadvance=22     page=0  chnl=0 
char id=92   x=0     y=0     width=24     height=72     xoffset=-2     yoffset=0    xadvance=22     page=0  chnl=0 
char id=47   x=24     y=0     width=24     height=72     xoffset=-2     yoffset=0    xadvance=22     page=0  chnl=0 
...

为了确保问题不是出在我的设置上,我检查了 LibGDX 的最新主分支并尝试 运行 GWT 测试:

git clone https://github.com/libgdx/libgdx.git
cd libgdx
ant -f fetch
ant
./gradlew tests:gdx-tests-gwt:draftRun

这似乎也失败了:

Compiling module com.badlogic.gdx.tests.gwt.GdxTestsGwt
   Finding entry point classes
      [ERROR] Errors in 'file:/C:/devtools/libgdx/gdx/src/com/badlogic/gdx/Net.java'
         [ERROR] Line 80: No source code is available for type java.io.InputStream; did you forget to inherit a required module?
      [ERROR] Errors in 'file:/C:/devtools/libgdx/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/GwtNet.java'
         [ERROR] Line 70: No source code is available for type java.io.InputStream; did you forget to inherit a required module?
      [ERROR] Errors in 'file:/C:/devtools/libgdx/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/preloader/Preloader.java'
         [ERROR] Line 200: No source code is available for type java.io.InputStream; did you forget to inherit a required module?
         [ERROR] Line 203: No source code is available for type java.io.ByteArrayInputStream; did you forget to inherit a required module?
      [ERROR] Errors in 'file:/C:/devtools/libgdx/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/com/badlogic/gdx/files/FileHandle.java'
         [ERROR] Line 78: No source code is available for type java.io.InputStream; did you forget to inherit a required module?
      [ERROR] Errors in 'file:/C:/devtools/libgdx/gdx/src/com/badlogic/gdx/net/Socket.java'
         [ERROR] Line 41: No source code is available for type java.io.InputStream; did you forget to inherit a required module?
      [ERROR] Errors in 'file:/C:/devtools/libgdx/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/preloader/Blob.java'
         [ERROR] Line 38: No source code is available for type java.io.InputStream; did you forget to inherit a required module?
      [ERROR] Errors in 'file:/C:/devtools/libgdx/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/io/BufferedInputStream.java'
         [ERROR] Line 19: No source code is available for type java.io.FilterInputStream; did you forget to inherit a required module?
         [ERROR] Line 20: No source code is available for type java.io.InputStream; did you forget to inherit a required module?
      [ERROR] Errors in 'file:/C:/devtools/libgdx/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/io/Reader.java'
         [ERROR] Line 33: No source code is available for type java.io.Closeable; did you forget to inherit a required module?
      [ERROR] Errors in 'file:/C:/devtools/libgdx/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/io/Writer.java'
         [ERROR] Line 30: No source code is available for type java.io.Closeable; did you forget to inherit a required module?
         [ERROR] Line 30: No source code is available for type java.io.Flushable; did you forget to inherit a required module?
      [ERROR] Unable to find type 'com.badlogic.gdx.tests.gwt.client.GwtTestStarter'
         [ERROR] Hint: Previous compiler errors may have made this type unavailable
         [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
:tests:gdx-tests-gwt:draftCompileGwt FAILED

知道这是怎么回事吗? (我的JavaSDK是jdk1.8.0_20)

看起来这是 LibGDX 1.9.5 中的错误。一些人已经提交了 pull requests 来修复它,所以我希望很快会有一个 1.9.6-SNAPSHOT 可以修复这个问题。

https://github.com/libgdx/libgdx/pull/4475

https://github.com/libgdx/libgdx/pull/4467