libGDX HTML5 deployment exception

主宰稳场 提交于 2019-12-02 07:51:08

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/19120018/libgdx-html5-deployment-exception

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!