harrane
harrane

Reputation: 969

libGDX HTML5 deployment exception

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.

Upvotes: 1

Views: 1821

Answers (1)

harrane
harrane

Reputation: 969

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.

Upvotes: 3

Related Questions