@coco6 写道:
Cocos Creator打包安卓,进MainActivity有概率报空指针异常,闪退,求大佬看看。闪退的概率不大,但偶尔会出现。
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.cocos2dx.lib.Cocos2dxActivity.runOnGLThread(java.lang.Runnable)' on a null object reference
at org.cocos2dx.lib.Cocos2dxHelper.runOnGLThread(Cocos2dxHelper.java:167)
at org.cocos2dx.lib.Cocos2dxAudioFocusManager.unregisterAudioFocusListener(Cocos2dxAudioFocusManager.java:118)
at org.cocos2dx.lib.Cocos2dxActivity.onDestroy(Cocos2dxActivity.java:376)
at org.cocos2dx.javascript.AppActivity.onDestroy(AppActivity.java:506)
at android.app.Activity.performDestroy(Activity.java:7684)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1306)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4824)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4857)
at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:39)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:150)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:73)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:226)
at android.app.ActivityThread.main(ActivityThread.java:7212)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:576)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:956)为啥老是发不不了,太坑了吧
帖子: 1
参与者: 1