尝试在 AndEngineExampleLauncher 中运行 Text 示例时的 Stackoverflow
嘿游戏引擎的朋友们,
这是一个为 Android 版 AndEngine 工作过的人的问题。
我在使 AndEngineExampleLauncher 的文本示例正常工作时遇到问题!
它抛出以下异常:
09-30 10:11:19.940: ERROR/AndroidRuntime(466): FATAL EXCEPTION: main
09-30 10:11:19.940: ERROR/AndroidRuntime(466): java.lang.StackOverflowError
09-30 10:11:19.940: ERROR/AndroidRuntime(466): at org.anddev.andengine.ui.activity.BaseGameActivity.getFontManager(BaseGameActivity.java:137)
09-30 10:11:19.940: ERROR/AndroidRuntime(466): at org.anddev.andengine.ui.activity.BaseGameActivity.getFontManager(BaseGameActivity.java:137)
09-30 10:11:19.940: ERROR/AndroidRuntime(466): at org.anddev.andengine.ui.activity.BaseGameActivity.getFontManager(BaseGameActivity.java:137)
我已经用谷歌搜索了该错误,似乎其他一些人也有同样的问题,但我找不到在任何地方发布的解决方案!
有没有人能够在不使用 80 年代和 80 年代的情况下使这个示例正常工作? 90 年代的 StackOverflowError!。
非常感谢您的帮助。
谢谢, 穆罕默德·卡里姆
Hey Game Engine Folks,
This is a question for those who worked with AndEngine for Android.
I've a problem getting the Text example of the AndEngineExampleLauncher working!
It throws the following exception:
09-30 10:11:19.940: ERROR/AndroidRuntime(466): FATAL EXCEPTION: main
09-30 10:11:19.940: ERROR/AndroidRuntime(466): java.lang.StackOverflowError
09-30 10:11:19.940: ERROR/AndroidRuntime(466): at org.anddev.andengine.ui.activity.BaseGameActivity.getFontManager(BaseGameActivity.java:137)
09-30 10:11:19.940: ERROR/AndroidRuntime(466): at org.anddev.andengine.ui.activity.BaseGameActivity.getFontManager(BaseGameActivity.java:137)
09-30 10:11:19.940: ERROR/AndroidRuntime(466): at org.anddev.andengine.ui.activity.BaseGameActivity.getFontManager(BaseGameActivity.java:137)
I've googled that error and it seems that some other guys having the same problem, but I couldn't find a solution posted anywhere!
Have anybody been able to get this example working without getting this 80's & 90's StackOverflowError!.
Really appreciate your help.
Thanks,
Mohamed A.Karim
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这很奇怪,但是我花了时间从 AndEngine src 调试 AndEngine BaseGameActivity.java 类,并且找到了问题的原因:
这是随 getFontManger() 方法一起提供的:
这是典型的 StackOverFlow 原因。 ..非常经典的一个。
我已将该方法更改为:
AndEngine Text 示例现在工作得非常顺利。
因此,以下是我为使 AndEngine Text 示例正常工作而完成的步骤:
1- 转到 AndEngine 项目(导入到游戏中的源代码)
2-转到类 org.anddev.andengine.ui.activity.BaseGameActivity.java
3-转到方法:getFontManager()
4-更改返回值
来自:返回this.getFontManager();
至:返回this.mEngine.getFontManager();
我希望这对任何遇到同样问题的人都有帮助
。真的很感谢 @Nicolas Gramlich 为创建如此令人难以置信的游戏引擎所做的巨大努力。
谢谢,
穆罕默德.
This is very odd, but I took the time to debug the AndEngine BaseGameActivity.java class from the AndEngine src and I've found the cause of the problem:
Here is the shipped with getFontManger() method:
This is the typical StackOverFlow cause... The very classic one.
I've changed that method to be:
And the AndEngine Text example is working like charm now.
So, here are the steps I've done to get the AndEngine Text example working:
1- Go to the AndEngine Project (Source code you import to your game)
2- Go to class org.anddev.andengine.ui.activity.BaseGameActivity.java
3- Go to method: getFontManager()
4- Change the return value
From: return this.getFontManager();
To: return this.mEngine.getFontManager();
I hope this can be a help for anybody who has the same problem
Really appreciate the great effort from @Nicolas Gramlich for creating such an incredible game engine.
Thanks,
Mohamed.