-
Creator 版本: 3.6.1
-
目标平台: 安卓
-
重现方式:无论用Creator构建->生成,还是使用Creator构建->AndroidStudio生成,生成的apk在安装后都会出现:游戏切后台返回/锁屏再开时应用卡死无响应。Java层测试activity为操作切后台OnPause,切回游戏OnRestart、OnResume,之后卡死,再次操作切后台时无activity打印。
-
首个报错:
从切后台操作到切回游戏的操作,Log日志如下:
2023-02-09 20:03:31.663 6428-6428 TopResumed…ChangeItem com.diw.hxt I execute start, ActivityClientRecord = ActivityRecord{52ba1be token=android.os.BinderProxy@356af6b {com.diw.hxt/com.cocos.game.AppActivity}}
2023-02-09 20:03:31.675 6428-6428 threaded_app com.diw.hxt V Pause: 0x7d951abc00
2023-02-09 20:03:31.684 6428-6471 threaded_app com.diw.hxt V activityState=13
2023-02-09 20:03:31.684 6428-6471 Cocos com.diw.hxt I 20:03:31 [INFO]: AndroidPlatform: APP_CMD_PAUSE
2023-02-09 20:03:31.684 6428-6428 COCOS_activity com.diw.hxt I onPause
2023-02-09 20:03:31.686 6428-6428 threaded_app com.diw.hxt V WindowFocusChanged: 0x7d951abc00 – 0
2023-02-09 20:03:31.699 6428-6471 Cocos com.diw.hxt I 20:03:31 [INFO]: AndroidPlatform: APP_CMD_LOST_FOCUS
2023-02-09 20:03:31.884 6428-6428 RmeSchedManager com.diw.hxt I init Rme, version is: v1.0
2023-02-09 20:03:32.226 3749-3896 DollieAdapterService pid-3749 E notifyActivityState pkg:com.diw.hxt/com.cocos.game.AppActivity state:15 fg:false mUid:10638
2023-02-09 20:03:32.233 6428-6428 threaded_app com.diw.hxt V NativeWindowDestroyed: 0x7d951abc00 – 0x7d7066e810
2023-02-09 20:03:32.233 6428-6428 threaded_app com.diw.hxt V android_app_set_window called
2023-02-09 20:03:32.281 6428-6471 threaded_app com.diw.hxt V APP_CMD_TERM_WINDOW
2023-02-09 20:03:32.281 6428-6471 Cocos com.diw.hxt D 20:03:32 [DEBUG]: AndroidPlatform: APP_CMD_TERM_WINDOW
2023-02-09 20:03:32.320 6428-6577 SwappyCommon com.diw.hxt I Swappy version 1.10
2023-02-09 20:03:32.320 6428-6577 SwappyCommon com.diw.hxt I SDK version = 31 preview = 0
2023-02-09 20:03:32.323 6428-6563 ChoreographerThread com.diw.hxt I Destroying NDKChoreographerThread
2023-02-09 20:03:32.372 6428-6577 ChoreographerThread com.diw.hxt I Terminating Looper thread
2023-02-09 20:03:32.421 6428-6471 threaded_app com.diw.hxt V APP_CMD_TERM_WINDOW
2023-02-09 20:03:32.422 6428-6428 HwApsImpl com.diw.hxt W not support full screen video recognize feature ## com.diw.hxt
2023-02-09 20:03:32.440 6428-6428 SurfaceView com.diw.hxt W notifySurfaceDestroyed
2023-02-09 20:03:32.441 6428-6428 SurfaceView com.diw.hxt W notifySurfaceDestroyed
2023-02-09 20:03:32.441 6428-6428 threaded_app com.diw.hxt V TrimMemory: 0x7d951abc00 20
2023-02-09 20:03:32.441 6428-6471 Cocos com.diw.hxt I 20:03:32 [INFO]: AndroidPlatform: APP_CMD_LOW_MEMORY
2023-02-09 20:03:32.441 6428-6428 WindowManager com.diw.hxt I trimMemory level: 20
2023-02-09 20:03:32.448 6428-6428 threaded_app com.diw.hxt V Stop: 0x7d951abc00
2023-02-09 20:03:32.448 6428-6471 threaded_app com.diw.hxt V activityState=14
2023-02-09 20:03:32.448 6428-6471 Cocos com.diw.hxt I 20:03:32 [INFO]: AndroidPlatform: APP_CMD_STOP
2023-02-09 20:03:32.448 6428-6471 GameControllerThread com.diw.hxt D unregisterInputDeviceListener
2023-02-09 20:03:32.448 6428-6471 InputManager com.diw.hxt I unregisterInputDeviceListener Thread[Thread-6,10,main]
2023-02-09 20:03:32.450 6428-6428 SurfaceView com.diw.hxt W notifySurfaceDestroyed
2023-02-09 20:03:32.453 6428-6428 threaded_app com.diw.hxt V SaveInstanceState: 0x7d951abc00
2023-02-09 20:03:32.453 6428-6471 Cocos com.diw.hxt D 20:03:32 [DEBUG]: AndroidPlatform: APP_CMD_SAVE_STATE
2023-02-09 20:03:32.453 6428-6471 threaded_app com.diw.hxt V APP_CMD_SAVE_STATE
2023-02-09 20:03:32.458 6428-6428 SurfaceView com.diw.hxt W notifySurfaceDestroyed
2023-02-09 20:03:33.309 1705-5350 ActivityTaskManager pid-1705 E ensureVisibilityAndConfig begin next:ActivityRecord{121df90 u0 com.diw.hxt/com.cocos.game.AppActivity t52003}
2023-02-09 20:03:33.311 1705-5350 ActivityTaskManager pid-1705 E ensureVisibilityAndConfig starting:ActivityRecord{121df90 u0 com.diw.hxt/com.cocos.game.AppActivity t52003}, kept:true
2023-02-09 20:03:33.311 1705-5350 ActivityTaskManager pid-1705 E ensureVisibilityAndConfig end next:ActivityRecord{121df90 u0 com.diw.hxt/com.cocos.game.AppActivity t52003}
2023-02-09 20:03:33.320 6428-6428 SurfaceView com.diw.hxt W notifySurfaceDestroyed
2023-02-09 20:03:33.352 6428-6428 DecorView com.diw.hxt I navBarColor: fffcfcfc statusBarColor: ff757575 statusInsets: Insets{left=0, top=141, right=0, bottom=0} navInsets: Insets{left=0, top=0, right=0, bottom=130}
2023-02-09 20:03:33.352 6428-6428 DecorView com.diw.hxt I updateColorViewInt type:1 size: 130 showView:false color:fffcfcfc
2023-02-09 20:03:33.352 6428-6428 DecorView com.diw.hxt I updateColorViewInt type:0 size: 141 showView:false color:ff757575
2023-02-09 20:03:33.353 6428-6428 threaded_app com.diw.hxt V WindowInsetsChanged: 0x7d951abc00
2023-02-09 20:03:33.353 6428-6471 Cocos com.diw.hxt D 20:03:33 [DEBUG]: AndroidPlatform: APP_CMD_WINDOW_INSETS_CHANGED
2023-02-09 20:03:33.353 6428-6428 SurfaceView com.diw.hxt W notifySurfaceDestroyed
2023-02-09 20:03:33.353 6428-6428 RmeSchedManager com.diw.hxt I init Rme, version is: v1.0
2023-02-09 20:03:33.353 6428-6428 RtgSchedEvent com.diw.hxt I current pid:6428 AppType:-1
2023-02-09 20:03:33.353 6428-6428 TopResumed…ChangeItem com.diw.hxt I execute start, ActivityClientRecord = ActivityRecord{52ba1be token=android.os.BinderProxy@356af6b {com.diw.hxt/com.cocos.game.AppActivity}}
2023-02-09 20:03:33.353 6428-6428 ActivityThread com.diw.hxt D Won’t deliver top position change in state=5
2023-02-09 20:03:33.354 6428-6428 COCOS_activity com.diw.hxt I onRestart
2023-02-09 20:03:33.354 6428-6428 threaded_app com.diw.hxt V Start: 0x7d951abc00
2023-02-09 20:03:33.354 6428-6471 threaded_app com.diw.hxt V activityState=10
2023-02-09 20:03:33.354 6428-6471 Cocos com.diw.hxt I 20:03:33 [INFO]: AndroidPlatform: APP_CMD_START
2023-02-09 20:03:33.355 6428-6471 GameControllerThread com.diw.hxt D registerInputDeviceListener
2023-02-09 20:03:33.355 6428-6428 SurfaceView com.diw.hxt W notifySurfaceDestroyed
2023-02-09 20:03:33.355 6428-6471 InputManager com.diw.hxt I registerInputDeviceListener Thread[Thread-6,10,main]
2023-02-09 20:03:33.357 6428-6428 threaded_app com.diw.hxt V Resume: 0x7d951abc00
2023-02-09 20:03:33.357 6428-6471 threaded_app com.diw.hxt V activityState=11
2023-02-09 20:03:33.357 6428-6471 Cocos com.diw.hxt I 20:03:33 [INFO]: AndroidPlatform: APP_CMD_RESUME
2023-02-09 20:03:33.359 6428-6428 COCOS_activity com.diw.hxt I onResume
2023-02-09 20:03:33.361 6428-6428 SurfaceView com.diw.hxt W notifySurfaceDestroyed
2023-02-09 20:03:33.383 6428-6428 BufferQueueCore com.diw.hxt D BufferQueueCore: mDebugHwFlow=0, mIsBufferQueueLogVSupport=0.
2023-02-09 20:03:33.384 6428-6428 InsetsSourceConsumer com.diw.hxt D setControl mType:1, requestedVisible:false, getLeash:null, needAnimation:true, mIsAnimationPending:false, getRootViewTitle:com.diw.hxt/com.cocos.game.AppActivity
2023-02-09 20:03:33.384 6428-6428 InsetsSourceConsumer com.diw.hxt D setControl mType:0, requestedVisible:false, getLeash:null, needAnimation:true, mIsAnimationPending:false, getRootViewTitle:com.diw.hxt/com.cocos.game.AppActivity
2023-02-09 20:03:33.385 6428-6428 DecorView com.diw.hxt I navBarColor: fffcfcfc statusBarColor: ff757575 statusInsets: Insets{left=0, top=141, right=0, bottom=0} navInsets: Insets{left=0, top=0, right=0, bottom=130}
2023-02-09 20:03:33.385 6428-6428 DecorView com.diw.hxt I updateColorViewInt type:1 size: 0 showView:false color:fffcfcfc
2023-02-09 20:03:33.385 6428-6428 DecorView com.diw.hxt I updateColorViewInt type:0 size: 141 showView:false color:ff757575
2023-02-09 20:03:33.385 6428-6428 threaded_app com.diw.hxt V WindowInsetsChanged: 0x7d951abc00
2023-02-09 20:03:33.386 6428-6471 Cocos com.diw.hxt D 20:03:33 [DEBUG]: AndroidPlatform: APP_CMD_WINDOW_INSETS_CHANGED
2023-02-09 20:03:33.392 6428-6428 BufferQueueCore com.diw.hxt D BufferQueueCore: mDebugHwFlow=0, mIsBufferQueueLogVSupport=0.
2023-02-09 20:03:33.392 6428-6428 SurfaceView com.diw.hxt I setLowResolutionInfo compatInfo.supportsScreen() is not satisfied
2023-02-09 20:03:33.393 6428-6428 threaded_app com.diw.hxt V NativeWindowCreated: 0x7d951abc00 – 0x7d70673810
2023-02-09 20:03:33.393 6428-6428 threaded_app com.diw.hxt V android_app_set_window called
2023-02-09 20:03:33.393 6428-6471 threaded_app com.diw.hxt V APP_CMD_INIT_WINDOW
2023-02-09 20:03:33.393 6428-6471 Cocos com.diw.hxt D 20:03:33 [DEBUG]: AndroidPlatform: APP_CMD_INIT_WINDOW
2023-02-09 20:03:33.393 6428-6563 Cocos com.diw.hxt I 20:03:33 [INFO]: Resizing surface: 1200x2640
2023-02-09 20:03:33.393 6428-6428 HwApsImpl com.diw.hxt W not support full screen video recognize feature ## com.diw.hxt
2023-02-09 20:03:33.393 6428-6428 threaded_app com.diw.hxt V NativeWindowRedrawNeeded: 0x7d951abc00 – 0x7d70673810
2023-02-09 20:03:33.419 3749-3896 DollieAdapterService pid-3749 E notifyActivityState pkg:com.diw.hxt/com.cocos.game.AppActivity state:2 fg:true mUid:10638
2023-02-09 20:03:33.419 6428-6428 HwViewRootImpl com.diw.hxt I removeInvalidNode all the node in jank list is out of time
2023-02-09 20:03:33.421 6428-6428 InsetsSourceConsumer com.diw.hxt D setControl mType:1, requestedVisible:false, getLeash:Surface(name=Surface(name=6bbfe45 NavigationBar0)/@0x42b030f - animation-leash of insets_animation)/@0x122d2ef, needAnimation:false, mIsAnimationPending:true, getRootViewTitle:com.diw.hxt/com.cocos.game.AppActivity
2023-02-09 20:03:33.421 6428-6428 InsetsSourceConsumer com.diw.hxt D setControl mType:0, requestedVisible:false, getLeash:Surface(name=Surface(name=83b4197 StatusBar)/@0x515a06e - animation-leash of insets_animation)/@0xbf2d1fc, needAnimation:false, mIsAnimationPending:true, getRootViewTitle:com.diw.hxt/com.cocos.game.AppActivity
2023-02-09 20:03:33.421 6428-6428 InsetsController com.diw.hxt I applyAnimation types:3,show:false, this:android.view.InsetsController@d5fca04
2023-02-09 20:03:33.422 6428-6428 InsetsController com.diw.hxt I controlAnimation types: 3
2023-02-09 20:03:33.422 6428-6428 InsetsController com.diw.hxt D controlAnimation after canel existing types: 3
2023-02-09 20:03:33.423 6428-6428 threaded_app com.diw.hxt V WindowFocusChanged: 0x7d951abc00 – 1
2023-02-09 20:03:33.423 6428-6428 InputMethodManager com.diw.hxt W startInputReason = 1
2023-02-09 20:03:33.424 6428-6428 HwRemoteIn…hodManager com.diw.hxt W isCasting false because IHwDistributedWindowManager is invalid.
2023-02-09 20:03:33.437 6428-6453 OpenGLRenderer com.diw.hxt I Davey! duration=9810ms; Flags=1, FrameTimelineVsyncId=133766323, IntendedVsync=1825257044183284, Vsync=1825257044183284, InputEventId=0, HandleInputStart=1825257053611588, AnimationStart=1825257053615234, PerformTraversalsStart=1825257053617318, DrawStart=1825257091229297, FrameDeadline=1825257077516616, FrameInterval=1825257053473047, FrameStartTime=16666666, SyncQueued=1825257093359505, SyncStart=1825257093448047, IssueDrawCommandsStart=1825257093623568, SwapBuffers=1825257109143359, FrameCompleted=1825266855133983, DequeueBufferDuration=14591666, QueueBufferDuration=647395, GpuCompleted=1825266855133983, SwapBuffersCompleted=1825257111120963, DisplayPresentTime=0,
2023-02-09 20:03:33.445 6428-6471 Cocos com.diw.hxt I 20:03:33 [INFO]: AndroidPlatform: APP_CMD_WINDOW_REDRAW_NEEDED
2023-02-09 20:03:33.445 6428-6471 Cocos com.diw.hxt I 20:03:33 [INFO]: AndroidPlatform: APP_CMD_GAINED_FOCUS
2023-02-09 20:03:33.662 6428-6428 threaded_app com.diw.hxt V TrimMemory: 0x7d951abc00 5
2023-02-09 20:03:33.662 6428-6428 WindowManager com.diw.hxt I trimMemory level: 5
想请问一下各位大佬可能是由什么原因引起的