libgdx发布html,LibGDX Uncaught RunTime Exception in HTML Deployment

问题

I seem to be getting an error when deploying my game to HTML. The menu screen works fine, then the transition to the game screen causes this error.

Text from console:

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

The errors seem to pile on by the millisecond as the window is kept open. The game runs perfectly on Desktop (windows and mac), Android, and iPhone. Not sure what's going on. I'm currently using about 6 different sounds, multiple textures/textureAtlas's, no fonts. The only extension I have for the project is the "Tools" extension.

I fixed the previous error I received after compiling HTML using the Reflection class. Not sure what to do about this error though.

This problem is similar to this thread from a year ago. I took a look at the build.gradle file in my HTML folder, "strict = true" within the compiler struct, so I'm assuming that's okay. My project also uses GL20 so I'm not sure if those solutions are applicable in this case.

Thanks for the help!

回答1:

Its been long time for this post and also I'm not sure about exact problem you faced here, I had similar exception but to find exact reasons I need to get hands on code.

What I did for my code:

in short: problem can be any obj.function() line, since this happens multiple times, I assume its in rendering loop of current screen.

more detail about my issue which I had solved:

I created class MyActor extends Actor, had a sprite and a TextureRegion (current frame from sprite), while creating replica of this object I was setting value for current frame (act method was fetching current frame but draw was getting called before act) and that was giving me similar error.

I'm not sure if this helps or not, do let me know if you make any progress with this.

来源:https://stackoverflow.com/questions/26578103/libgdx-uncaught-runtime-exception-in-html-deployment

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值