LibGDX Uncaught RunTime Exception when deploying HTML

I seem to get an error when deploying my game in HTML. The menu screen works fine, then switching to the game screen causes this error.

screen_shot

Text from the console:

Uncaught java.lang.RuntimeException: com.google.gwt.core.client.JavaScriptException: (TypeError) gwt$exception: <skipped>: Cannot read property 'get_5' of null 

It seems that the errors flicker millisecond, since the window remains open. The game works great on Desktop (windows and mac), Android and iPhone. Not sure what is going on. Currently I use about 6 different sounds, several textures / textureAtlas, no fonts. The only extension I have for the project is the Tools extension.

I fixed the previous error obtained after compiling HTML using the Reflection class. Not sure what to do with this error.

This problem is similar to this thread from a year ago. I looked at the build.gradle file in my HTML folder "strict = true" inside the compiler structure, so I assume that everything is fine. My project also uses GL20, so I'm not sure if these solutions apply in this case.

Thanks for the help!

+5
source share
1 answer

Its a long time for this post, and also I'm not sure about the exact problem you encountered here, I had a similar exception, but in order to find the exact reasons, I need to get the code.

What I did for my code: In short, any obj.function() line can be a problem, since this happens several times, I assume it is in the render cycle of the current screen.

in more detail about my problem that I solved: I created the MyActor extends Actor class, had a sprite and TextureRegion (current frame from the sprite), creating a replica of this object, I set the value for the current frame (the act method was fetching the current frame, but drawing got called before the action), and it gave me a similar error.

I'm not sure if this helps or not, let me know if you achieve this.

0
source

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


All Articles