首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >LibGDX 1.9.5上GWT (2.8.0)的字体文件解析错误

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

Stack Overflow用户
提问于 2016-12-12 20:58:12
回答 1查看 288关注 0票数 3

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

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

代码语言:javascript
复制
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: ""

字体以前一直在工作,我得到了与任何字体相同的结果,包括来自default.fnt测试的LibGDX。字体文件的顶部如下所示:

代码语言:javascript
复制
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测试:

代码语言:javascript
复制
git clone https://github.com/libgdx/libgdx.git
cd libgdx
ant -f fetch
ant
./gradlew tests:gdx-tests-gwt:draftRun

这似乎也失败了:

代码语言:javascript
复制
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是jdk1.8.0_20)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-12-13 21:34:18

看起来这是LibGDX 1.9.5中的一个bug。有几个人已经提交了请求来修复这个问题,所以我预计很快就会有一个1.9.6的快照来解决这个问题。

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

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

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41109432

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档