libGDX HTML5部署异常 [英] libGDX HTML5 deployment exception

查看:119
本文介绍了libGDX HTML5部署异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用GWT编译libGDX项目(libgdx-project-html右键 - > Google - > GWT编译)。

编译除外


com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop.Target
java.lang.StringIndexOutOfBoundsException
p>

但是因为我没有使用这个util应该不是问题。



编译后说它成功了,我运行了本地托管站点。



LibGDX徽标和加载栏出现了(直到这里),并且完成后,我得到一个黑色的游戏屏幕和下面的一个框无限


GwtApplication:异常:(TypeError):无法调用方法
'nullMethod'null(TypeError):无法调用
null的方法'nullMethod'

消息行。 p>

在控制台中,连续重复以下消息:


未捕获的java.lang.RuntimeException:
com.google.gwt.core.client.JavaScriptException:(TypeError):Can not
调用null方法'nullMethod'(匿名函数)
597957B2399D3903739C615799AE1A15.cache.html:11899

该项目基本上没有什么但是libGDX的标识应该出现并填充游戏屏幕(默认的),并且没有修改代码。

一些附加注释:



桌面和Android编译完美无瑕。

控制台表示SoundManager 2在错误消息出现之前加载(确定) p>

严格标志在GWT编译和所有内容编译时都没有错误时设置。



确保通过添加
$来设置严格标志b $ b

-strict



在编译参数中,最重要的是,您正在使用

GL20



,因为WebGL基于GL20,不支持GL10。


I am trying to compile the libGDX project using GWT (libgdx-project-html right click -> Google -> GWT Compile).

I get no errors while compiling except

com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop.Target java.lang.StringIndexOutOfBoundsException

but since I'm not using this util should not be a problem.

After the compilation says that it was successful, I ran the local hosted site.

LibGDX logo and loading bar come up (fine until here), and when they are done, I get a black game screen and a box below it with unlimited

GwtApplication: exception: (TypeError) : Cannot call method 'nullMethod' of null (TypeError) : Cannot call method 'nullMethod' of null

message lines.

In the console the following message is repeated continuously:

Uncaught java.lang.RuntimeException: com.google.gwt.core.client.JavaScriptException: (TypeError) : Cannot call method 'nullMethod' of null (anonymous function) 597957B2399D3903739C615799AE1A15.cache.html:11899

The project basically is nothing but the logo of libGDX that should come up and fill the game screen (the default one) and no code has been modified.

Some additional notes:

Desktop and Android compile and work flawlessly.

Console says SoundManager 2 loaded (OK) before that error message comes up.

Strict flag is set when GWT compiling and everything are compiled with no errors.

解决方案

For anyone having the same problem or any other similar/weird exceptions.

Make sure that strict flag is set by adding

-strict

in the compiling arguments and most importantly, you are using

GL20

as WebGL is based on GL20 and doesn't support GL10.

这篇关于libGDX HTML5部署异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆