LibGDX HTML5 implementation exception

I am trying to compile a libGDX project using GWT (right click -> Google -> GWT).

I get no compilation errors except

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

but since I do not use this utility, this is not a problem.

After compilation, it says that it was successful, I launched a local hosted site.

The LibGDX logo and loading panel will appear (still great), and when they end, I get a black game screen and a box under it with unlimited

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

.

In the console, the following message is repeated continuously:

Do not use java.lang.RuntimeException: com.google.gwt.core.client.JavaScriptException: (TypeError): Can not call the "nullMethod" method from null (anonymous function) 597957B2399D3903739C615799AE1A15.cache.html: 11899

Basically, a project is nothing more than a libGDX logo, which should appear and fill the game screen (by default), and the code has not been changed.

Some additional notes:

Desktop and Android compilation and work flawlessly.

The console says that SoundManager 2 is loaded (OK) before this error message appears.

A strict flag is set when GWT is compiled and all compiled without errors.

+1
source share
1 answer

For those who have the same problem or any other similar / strange exceptions.

Make sure strict flag is set by adding

-strict

in compilation arguments and most importantly you use

GL20

since WebGL is based on GL20 and does not support GL10.

+3
source

Source: https://habr.com/ru/post/1205565/


All Articles