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

时间:2016-12-12 20:58:13

标签: gwt libgdx

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

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

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

有什么想法在这里发生了什么? (我的Java SDK是jdk1.8.0_20)

1 个答案:

答案 0 :(得分:2)

看起来这是LibGDX 1.9.5中的一个错误。有几个人已经提交拉动请求来修复它,所以我预计很快会有一个1.9.6-SNAPSHOT可以解决这个问题。

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

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