我正在尝试解决由Cocos2d-x创建的游戏中的onResume
错误。当我走向背景并回到游戏时,游戏就会崩溃。和log-cat一样。
11:49:10.997 E/cocos2d-x: cocos2d: warning, Director::setProjection() failed because size is 0
11:49:11.001 D/Cocos2dxActivity: onWindowFocusChanged() hasFocus=true
11:49:11.020 D/FA: Connected to remote service
11:49:11.020 V/FA: Processing queued up service tasks: 4
11:49:11.062 D/Cocos2dxActivity: onPause()
11:49:11.064 D/AudioFocusManager: abandonAudioFocus succeed!
11:49:11.077 D/Cocos2dxActivity: onWindowFocusChanged() hasFocus=false
11:49:11.080 V/FA: onActivityCreated
11:49:11.087 I/SDKBOX_CORE: Sdkbox Droid starting.
11:49:11.087 I/SDKBOX_CORE: Sdkbox got VM.
11:49:11.087 I/SDKBOX_CORE: Initialize is called more than once.
11:49:11.094 D/Cocos2dxActivity: model=MotoE2
11:49:11.094 D/Cocos2dxActivity: product=otus_reteu_ds
11:49:11.094 D/Cocos2dxActivity: isEmulator=false
11:49:11.099 D/AutoManageHelper: starting AutoManage for client 0 false null
11:49:11.103 D/AutoManageHelper: onStart true {0=com.google.android.gms.internal.zzbau$zza@2efa3200}
11:49:11.106 D/Cocos2dxActivity: onResume()
11:49:11.109 D/AudioFocusManager: requestAudioFocus succeed
11:49:11.187 D/Cocos2dxActivity: onWindowFocusChanged() hasFocus=true
11:49:11.208 V/FA: Screen exposed for less than 1000 ms. Event not sent. time: 360
11:49:11.214 V/FA: Activity paused, time: 2492571
11:49:11.215 V/FA: Activity resumed, time: 2492614
11:49:11.674 D/cocos2d-x: reload all texture
11:49:11.674 E/cocos2d-x: cocos2d: warning, Director::setProjection() failed because size is 0
11:49:11.706 D/cocos2d-x debug info: Cocos2d-x-lite v1.6.0
11:49:12.411 A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x1aa in tid 16084 (GLThread 1061)
11:49:12.411 A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 16061 (GLThread 1048)
我总是看到这两个错误日志。
11:49:12.411 A / libc:致命信号11(SIGSEGV),代码1,故障地址0x1aa in tid 16084(GLThread 1061
11:49:11.674 E / cocos2d-x:cocos2d:警告,Director :: setProjection()失败,因为size为0
我已经尝试了这个但是没有用。