HTML部署中的LibGDX未捕获的运行时异常 [英] LibGDX Uncaught RunTime Exception in HTML Deployment

查看:96
本文介绍了HTML部署中的LibGDX未捕获的运行时异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将游戏部署到HTML时似乎出现错误.菜单屏幕工作正常,然后过渡到游戏屏幕会导致此错误.

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.

控制台文本:

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

当窗口保持打开状态时,错误似乎会在毫秒之前累积.该游戏可以在台式机(Windows和Mac),Android和iPhone上完美运行.不知道发生了什么.我目前正在使用大约6种不同的声音,多种纹理/textureAtlas,没有字体.我对该项目的唯一扩展是工具"扩展.

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.

我修复了使用Reflection类编译HTML后收到的上一个错误.但不确定如何处理此错误.

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

此问题类似于一年前的此线程.我看了一下我的HTML文件夹中的build.gradle文件,在编译器结构中为"strict = true",因此我认为这是可以的.我的项目也使用GL20,所以我不确定这些解决方案在这种情况下是否适用.

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.

感谢您的帮助!

推荐答案

这篇文章已经花了很长时间了,而且我不确定您在这里遇到的确切问题,我也有类似的例外,但是为了找到确切的原因,我需要掌握代码.

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.

我为代码做了什么: 简而言之:问题可能是任何obj.function()行,因为这多次发生,所以我假设它出现在当前屏幕的渲染循环中.

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.

有关我已解决的问题的更多详细信息: 我创建了类MyActor扩展了Actor,具有一个sprite和一个TextureRegion(来自sprite的当前帧),在创建该对象的副本时,我正在为当前帧设置值(act方法正在获取当前帧,但是绘制正在获取在行为发生前致电),这给了我类似的错误.

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.

这篇关于HTML部署中的LibGDX未捕获的运行时异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆