简体   繁体   English

随机应用程序崩溃-致命的开发人员错误

[英]Random application crashes - Fatal developer error

I'm currently developing an Android Game Application and am almost done but stumbled upon some problems. 我目前正在开发一个Android游戏应用程序,已经完成了,但是偶然发现了一些问题。 I had no need for Google Play Services in my game until now, when i need to implement leaderboards and achievements. 直到现在,我需要实现排行榜和成就时,才需要在游戏中使用Google Play服务。 This is where the problem popped up. 这是问题弹出的地方。 After adding required libraries I made all my game activities extend BaseGameActivity. 添加所需的库后,我使所有游戏活动都扩展了BaseGameActivity。 The first problem that showed up was regarding the calls of 出现的第一个问题是关于

         requestWindowFeature(Window.FEATURE_NO_TITLE);
         getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
         WindowManager.LayoutParams.FLAG_FULLSCREEN);

and it said that i have to call requestFeature() before adding content, which I think I did , since I'm calling setContentView after it. 它说我必须在添加内容之前调用requestFeature(),我想我这样做了,因为在此之后我要调用setContentView I decided to resolve (better expression would be ignore) this problem by commenting above code. 我决定通过注释上面的代码来解决此问题(更好的表达方式将被忽略)。 After running the application after that, every times it crashes after a random period of time giving me the following error: 之后运行该应用程序,它在随机的一段时间后每次崩溃都会给我以下错误:

08-17 13:55:43.879: I/dalvikvm(30369): Could not find method android.view.View.getDisplay, referenced from method com.google.android.gms.games.internal.PopupManager$PopupManagerHCMR1.h
08-17 13:55:43.879: W/dalvikvm(30369): VFY: unable to resolve virtual method 9019: Landroid/view/View;.getDisplay ()Landroid/view/Display;
08-17 13:55:43.879: D/dalvikvm(30369): VFY: replacing opcode 0x6e at 0x0009
08-17 13:55:43.910: W/PopupManager(30369): You have not specified a View to use as content view for popups. Falling back to the Activity content view which may not work properly in future versions of the API. Use setViewForPopups() to set your content view.
08-17 13:55:43.940: D/dalvikvm(30369): GC_FOR_ALLOC freed 181K, 14% free 7567K/8711K, paused 22ms, total 22ms
08-17 13:55:43.970: I/dalvikvm-heap(30369): Grow heap (frag case) to 12.105MB for 4008020-byte allocation
08-17 13:55:44.020: D/dalvikvm(30369): GC_CONCURRENT freed 1K, 10% free 11480K/12679K, paused 15ms+2ms, total 52ms
08-17 13:55:44.020: D/dalvikvm(30369): WAIT_FOR_CONCURRENT_GC blocked 7ms
08-17 13:55:44.040: D/dalvikvm(30369): GC_FOR_ALLOC freed 0K, 10% free 11480K/12679K, paused 21ms, total 21ms
08-17 13:55:44.080: I/dalvikvm-heap(30369): Grow heap (frag case) to 13.801MB for 1779572-byte allocation
08-17 13:55:44.140: D/dalvikvm(30369): GC_CONCURRENT freed 0K, 9% free 13218K/14471K, paused 7ms+3ms, total 54ms
08-17 13:55:44.140: D/dalvikvm(30369): WAIT_FOR_CONCURRENT_GC blocked 14ms
08-17 13:55:44.430: D/libEGL(30369): loaded /system/lib/egl/libGLES_rhea.so
08-17 13:55:44.640: D/BRCM_EGL(30369): eglCreateContext() config: 19 context: 0x4a087130, VC context 1, Thread 30369
08-17 13:55:44.640: D/BRCM_EGL(30369): eglCreateWindowSurface() surface: 0x4a0871a8, VC surface: 1, Thread: 30369
08-17 13:55:44.650: D/BRCM_EGL(30369): eglMakeCurrent(0x4a087130, 0x4a0871a8, 0x4a0871a8) Thread: 30369
08-17 13:55:44.680: D/OpenGLRenderer(30369): Enabling debug mode 0
08-17 13:55:44.850: D/dalvikvm(30369): GC_FOR_ALLOC freed 4730K, 38% free 9829K/15687K, paused 47ms, total 47ms
08-17 13:55:44.890: D/dalvikvm(30369): GC_FOR_ALLOC freed <1K, 34% free 10398K/15687K, paused 40ms, total 40ms
08-17 13:55:44.890: I/dalvikvm-heap(30369): Grow heap (frag case) to 12.205MB for 1213956-byte allocation
08-17 13:55:44.981: D/dalvikvm(30369): GC_CONCURRENT freed 0K, 27% free 11583K/15687K, paused 14ms+2ms, total 83ms
08-17 13:55:44.981: D/dalvikvm(30369): WAIT_FOR_CONCURRENT_GC blocked 69ms
08-17 13:55:44.981: D/dalvikvm(30369): WAIT_FOR_CONCURRENT_GC blocked 20ms
08-17 13:55:48.814: D/AndroidRuntime(30369): Shutting down VM
08-17 13:55:48.814: W/dalvikvm(30369): threadid=1: thread exiting with uncaught exception (group=0x415ae2a0)
08-17 13:55:48.864: E/AndroidRuntime(30369): FATAL EXCEPTION: main
08-17 13:55:48.864: E/AndroidRuntime(30369): java.lang.IllegalStateException: A fatal developer error has occurred. Check the logs for further information.
08-17 13:55:48.864: E/AndroidRuntime(30369):    at com.google.android.gms.internal.hb$h.b(Unknown Source)
08-17 13:55:48.864: E/AndroidRuntime(30369):    at com.google.android.gms.internal.hb$h.d(Unknown Source)
08-17 13:55:48.864: E/AndroidRuntime(30369):    at com.google.android.gms.internal.hb$b.fv(Unknown Source)
08-17 13:55:48.864: E/AndroidRuntime(30369):    at com.google.android.gms.internal.hb$a.handleMessage(Unknown Source)
08-17 13:55:48.864: E/AndroidRuntime(30369):    at android.os.Handler.dispatchMessage(Handler.java:99)
08-17 13:55:48.864: E/AndroidRuntime(30369):    at android.os.Looper.loop(Looper.java:137)
08-17 13:55:48.864: E/AndroidRuntime(30369):    at android.app.ActivityThread.main(ActivityThread.java:4944)
08-17 13:55:48.864: E/AndroidRuntime(30369):    at java.lang.reflect.Method.invokeNative(Native Method)
08-17 13:55:48.864: E/AndroidRuntime(30369):    at java.lang.reflect.Method.invoke(Method.java:511)
08-17 13:55:48.864: E/AndroidRuntime(30369):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
08-17 13:55:48.864: E/AndroidRuntime(30369):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
08-17 13:55:48.864: E/AndroidRuntime(30369):    at dalvik.system.NativeStart.main(Native Method)

I did some reading online and I think this might be due to my incorrect use of Threads in my app. 我在网上做了一些阅读,我认为这可能是由于我在应用程序中错误地使用了线程。 The app works on the principle described here ie uses a Handler, which never cause problems before, until my activity inherited BaseGameUtils. 该应用程序按照此处描述的原理工作,即使用一个处理程序,该处理程序以前从未引起问题,直到我的活动继承了BaseGameUtils。 What could be causing there problems. 是什么引起了问题。 I know these are two different question but both are related to the same thing - BaseGameActivity which caused my app to change it's behavior. 我知道这是两个不同的问题,但是都与同一件事相关-BaseGameActivity导致我的应用更改其行为。 Thanks ;) 谢谢 ;)

Check your application ID generated after authentication. 检查认证后生成的应用程序ID。 I had the same issue because I copied the ID incorrectly. 我遇到了同样的问题,因为我错误地复制了ID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM