Game always restarts instead of resuming in a specific scenario (Nexus 9)

Following steps leads to game restarting instead of resuming and this happens only on Nexus 9.

  1. When game is on, I click on recent tasks button (square button on bottom right).
  2. Click on home button (circle button on bottom middle)
  3. Click on recent tasks button and launch the game.

Instead of resuming, game restarts. When I tried the same steps on other android devices, it didnt restart.

I have read old posts that hint about corrupted TTF labels (which I am using as well) causes game to restart. Could that be the issue exist even on latest cocos version?

If yes how do I fix it?

What other issues can cause the game to restart only with these specific steps?

Memory issue? Android kills background app, if memory is needed. Also in the developer options (at the bottom) there is an option Don’t keep activities. Maybe this is activated?

Thanks for your reply.
I did check whether ‘Don’t keep activities’ flag was on or not and it wasn’t. I wonder if it was an memory issue, it would kill the app every time. Here it only kills in the specific scenario that I have mentioned. Does the OS requires extra memory when I perform the mentioned steps ?

I don’t think so.

All I know is, that if an app has a “cold start” there are three possible scenarios:

  • close with back button
  • closed by crash
  • closed by memory issues

Why it is on your device, I hope the logcat will tell more. You can check the logcat in the moment, you press the “recent” button. Maybe you find something interesting about the issue there. Remember to deactivate the filter in Android Studio, because it only shows the current app by default.

I performed 2 tests and checked the log to get a better understanding of issue

1.On Nexus 9 while game is on, I tapped on recent apps and then tapped on home button.

02-14 05:54:08.591: D/Cocos2dxActivity(17007): onPause()
02-14 05:54:08.634: D/Cocos2dxActivity(17007): onPause complete
02-14 05:54:08.664: D/Cocos2dxActivity(17007): onWindowFocusChanged() hasFocus=false
02-14 05:54:08.711: D/NuPlayerDriver(257): pause(0xe73a0b40)
02-14 05:54:08.712: D/NuPlayerDriver(257): notifyListener_l(0xe73a0b40), (7, 0, 0), loop setting(0, 1)
02-14 05:54:08.722: D/cocos2d-x debug info(17007): Paused called
02-14 05:54:08.738: D/NuPlayerDriver(257): reset(0xe73a0b40) at state 6
02-14 05:54:08.738: D/NuPlayerDriver(257): notifyListener_l(0xe73a0b40), (8, 0, 0), loop setting(0, 1)
02-14 05:54:08.750: W/MediaPlayer(17007): mediaplayer went away with unhandled events
02-14 05:54:08.755: W/AMessage(257): failed to post message as target looper for handler 0 is gone.
02-14 05:54:08.757: D/NuPlayerDriver(257): notifyResetComplete(0xe73a0b40)
02-14 05:54:08.807: D/NuPlayerDriver(257): notifyListener_l(0xe73a0b40), (1, 0, 0), loop setting(0, 0)
02-14 05:54:08.809: D/MediaPlayer(17007): setSubtitleAnchor in MediaPlayer
02-14 05:54:08.809: D/MediaPlayer(17007): setSubtitleAnchor in MediaPlayer
02-14 05:54:08.874: I/art(607): Background partial concurrent mark sweep GC freed 30015(1497KB) AllocSpace objects, 0(0B) LOS objects, 33% free, 17MB/26MB, paused 2.278ms total 315.508ms
02-14 05:54:09.122: W/art(17318): Suspending all threads took: 5.583ms
02-14 05:54:09.215: W/art(17318): Suspending all threads took: 6.270ms
02-14 05:54:09.399: I/Choreographer(916): Skipped 55 frames!  The application may be doing too much work on its main thread.
02-14 05:54:09.508: I/art(607): Background partial concurrent mark sweep GC freed 4784(219KB) AllocSpace objects, 0(0B) LOS objects, 33% free, 17MB/26MB, paused 9.906ms total 220.880ms
02-14 05:54:09.719: I/ActivityManager(607): Start proc 17456:com.facebook.katana:notification/u0a110 for service com.facebook.katana/com.facebook.rti.push.service.FbnsService
02-14 05:54:09.722: D/AppStateLogger(15781): Successfully dumped app state to log file
02-14 05:54:09.728: W/System.err(17318): java.lang.UnsatisfiedLinkError: dlopen failed: library "/data/user/0/com.estrongs.android.pop/files/lib/libacceleratecoreproxy.so" not found
02-14 05:54:09.748: D/test(17007): OnStop Called
02-14 05:54:09.778: I/Finsky(17154): [1] com.google.android.finsky.setup.az.a(213): Restore complete with 0 success and 0 failed.
02-14 05:54:09.791: W/System.err(17318): 	at java.lang.Runtime.load0(Runtime.java:908)
02-14 05:54:09.791: W/System.err(17318): 	at java.lang.System.load(System.java:1505)
02-14 05:54:09.791: W/System.err(17318): 	at com.dianxinos.a.c.a.g(Unknown Source)
02-14 05:54:09.791: W/System.err(17318): 	at com.dianxinos.a.c.a.e(Unknown Source)
02-14 05:54:09.791: W/System.err(17318): 	at com.dianxinos.a.c.a.c(Unknown Source)
02-14 05:54:09.791: W/System.err(17318): 	at com.dianxinos.a.a.a(Unknown Source)
02-14 05:54:09.791: W/System.err(17318): 	at com.duapps.scene.a.a(Unknown Source)
02-14 05:54:09.791: W/System.err(17318): 	at com.estrongs.android.pop.app.b.a.a(Unknown Source)
02-14 05:54:09.791: W/System.err(17318): 	at com.estrongs.android.pop.FexApplication.s(Unknown Source)
02-14 05:54:09.791: W/System.err(17318): 	at com.estrongs.android.pop.FexApplication.a(Unknown Source)
02-14 05:54:09.792: W/System.err(17318): 	at com.estrongs.android.pop.FexApplication$2.run(Unknown Source)
02-14 05:54:09.893: I/WearableService(1202): Wearable Services stopping
02-14 05:54:09.978: D/ApplicationLoaders(17318): ignored Vulkan layer search path /data/app/com.google.android.gms-1/lib/arm:/system/fake-libs:/data/app/com.google.android.gms-1/base.apk!/lib/armeabi-v7a for namespace 0xf6d4b0d0
02-14 05:54:10.166: I/Finsky(17154): [1] com.google.android.finsky.ce.a.onTrimMemory(5): Memory trim requested to level 80
02-14 05:54:10.366: V/DeadZone(916): consuming errant click: (1003.1202,4.029907)
02-14 05:54:10.405: W/art(17318): Suspending all threads took: 10.441ms
02-14 05:54:10.517: I/System.out(17318): AppsFlyerLib.sendTrackingWithEvent
02-14 05:54:10.602: W/System(17407): ClassLoader referenced unknown path: /data/app/com.google.android.calendar-1/lib/arm64
02-14 05:54:10.667: W/art(17318): Suspending all threads took: 73.851ms
02-14 05:54:10.702: W/art(17318): Verification of com.dianxinos.dxservice.stat.x$a com.dianxinos.dxservice.stat.x.f() took 125.845ms
02-14 05:54:10.917: I/UpnpServiceImpl(17318): >>> Starting UPnP service...
02-14 05:54:10.917: I/UpnpServiceImpl(17318): Using configuration: com.estrongs.dlna.core.d
02-14 05:54:10.925: I/Router(17318): WiFi is enabled (or running on Android emulator), starting router immediately
02-14 05:54:10.934: I/Router(17318): Creating Router: org.teleal.cling.transport.RouterImpl
02-14 05:54:10.952: I/NetworkAddressFactory(17318): Discovered WiFi network interface: wlan0
02-14 05:54:10.978: I/StreamServer(17318): Created socket (for receiving TCP streams) on: /192.168.0.100:35121
02-14 05:54:10.989: I/MulticastReceiver(17318): Creating wildcard socket (for receiving multicast datagrams) on port: 1900
02-14 05:54:11.025: W/art(17318): Suspending all threads took: 31.627ms
02-14 05:54:11.044: I/MulticastReceiver(17318): Joining multicast group: /239.255.255.250:1900 on network interface: wlan0
02-14 05:54:11.048: I/DatagramIO(17318): Creating bound socket (for datagram input/output) on: /192.168.0.100
02-14 05:54:11.113: I/UpnpServiceImpl(17318): <<< UPnP service started successfully
02-14 05:54:11.131: I/Router(17318): WiFi state changed, trying to enable router
02-14 05:54:11.401: W/art(17318): Suspending all threads took: 28.112ms
02-14 05:54:11.631: W/ls(17492): type=1400 audit(0.0:1991): avc: denied { getattr } for path="/verity_key" dev="rootfs" ino=4791 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.638: W/ls(17492): type=1400 audit(0.0:1992): avc: denied { getattr } for path="/ueventd.rc" dev="rootfs" ino=4789 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.638: W/ls(17492): type=1400 audit(0.0:1993): avc: denied { getattr } for path="/ueventd.flounder64.rc" dev="rootfs" ino=4788 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.638: W/ls(17492): type=1400 audit(0.0:1994): avc: denied { getattr } for path="/ueventd.flounder.rc" dev="rootfs" ino=4787 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.659: W/art(17407): Verification of void com.google.android.calendar.CalendarApplication.<clinit>() took 115.337ms
02-14 05:54:11.730: I/ActivityManager(607): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.google.android.googlequicksearchbox/com.google.android.launcher.GEL} from uid 10022 on display 0
02-14 05:54:11.638: W/ls(17492): type=1400 audit(0.0:1995): avc: denied { getattr } for path="/service_contexts" dev="rootfs" ino=4783 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.638: W/ls(17492): type=1400 audit(0.0:1996): avc: denied { getattr } for path="/sepolicy" dev="rootfs" ino=4782 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.638: W/ls(17492): type=1400 audit(0.0:1997): avc: denied { getattr } for path="/selinux_version" dev="rootfs" ino=4781 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.638: W/ls(17492): type=1400 audit(0.0:1998): avc: denied { getattr } for path="/seapp_contexts" dev="rootfs" ino=4780 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.638: W/ls(17492): type=1400 audit(0.0:1999): avc: denied { getattr } for path="/init.zygote64_32.rc" dev="rootfs" ino=4760 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.638: W/ls(17492): type=1400 audit(0.0:2000): avc: denied { getattr } for path="/init.zygote32.rc" dev="rootfs" ino=4759 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.641: W/ls(17492): type=1400 audit(0.0:2001): avc: denied { getattr } for path="/init.usb.rc" dev="rootfs" ino=4758 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.641: W/ls(17492): type=1400 audit(0.0:2002): avc: denied { getattr } for path="/init.usb.configfs.rc" dev="rootfs" ino=4757 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.641: W/ls(17492): type=1400 audit(0.0:2003): avc: denied { getattr } for path="/init.recovery.flounder64.rc" dev="rootfs" ino=4756 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.641: W/ls(17492): type=1400 audit(0.0:2004): avc: denied { getattr } for path="/init.recovery.flounder.rc" dev="rootfs" ino=4755 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.641: W/ls(17492): type=1400 audit(0.0:2005): avc: denied { getattr } for path="/init.rc" dev="rootfs" ino=4754 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.641: W/ls(17492): type=1400 audit(0.0:2006): avc: denied { getattr } for path="/init.flounder64.usb.rc" dev="rootfs" ino=4753 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.641: W/ls(17492): type=1400 audit(0.0:2007): avc: denied { getattr } for path="/init.flounder64.rc" dev="rootfs" ino=4752 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.641: W/ls(17492): type=1400 audit(0.0:2008): avc: denied { getattr } for path="/init.flounder.usb.rc" dev="rootfs" ino=4751 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.641: W/ls(17492): type=1400 audit(0.0:2009): avc: denied { getattr } for path="/init.flounder.rc" dev="rootfs" ino=4750 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.641: W/ls(17492): type=1400 audit(0.0:2010): avc: denied { getattr } for path="/init.environ.rc" dev="rootfs" ino=4749 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
02-14 05:54:11.926: W/art(17407): Verification of void com.google.android.calendar.CalendarApplication.onCreate() took 125.403ms
02-14 05:54:12.179: I/ActivityManager(607): Start proc 17502:com.google.android.googlequicksearchbox:search/u0a24 for service com.google.android.googlequicksearchbox/com.google.android.apps.gsa.sidekick.main.remoteservice.NowService
02-14 05:54:12.266: I/OpenGLRenderer(1263): Initialized EGL, version 1.4
02-14 05:54:12.266: D/OpenGLRenderer(1263): Swap behavior 2
02-14 05:54:12.414: I/art(17407): Waiting for a blocking GC DisableMovingGc
02-14 05:54:12.415: I/art(17407): Starting a blocking GC DisableMovingGc
02-14 05:54:12.830: I/art(17502): Starting a blocking GC AddRemoveAppImageSpace
02-14 05:54:12.835: W/OpenGLRenderer(1263): Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...
02-14 05:54:12.929: W/art(17407): Verification of int com.google.android.calendar.Utils.adjustColorLightness(int, float) took 283.178ms
02-14 05:54:12.972: I/ActivityManager(607): Process com.mycompany.mygame (pid 17007) has died
02-14 05:54:12.972: D/ActivityManager(607): cleanUpApplicationRecord -- 17007
02-14 05:54:12.978: D/NuPlayerDriver(257): reset(0xe73a0b40) at state 4
02-14 05:54:12.978: D/NuPlayerDriver(257): notifyListener_l(0xe73a0b40), (8, 0, 0), loop setting(0, 0)
02-14 05:54:12.980: I/WindowManager(607): WIN DEATH: Window{1d8e8f7 u0 com.mycompany.mygame/org.cocos2dx.cpp.AppActivity}
02-14 05:54:12.980: D/GraphicsStats(607): Buffer count: 4
02-14 05:54:12.981: D/NuPlayerDriver(257): notifyResetComplete(0xe73a0b40)
02-14 05:54:12.987: W/WindowManager(607): Force-removing child win Window{76c33a9 u0 SurfaceView - com.mycompany.mygame/org.cocos2dx.cpp.AppActivity} from container Window{1d8e8f7 u0 com.mycompany.mygame/org.cocos2dx.cpp.AppActivity}
02-14 05:54:13.038: W/WindowManager(607): Failed looking up window
02-14 05:54:13.038: W/WindowManager(607): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@c4639cd does not exist
02-14 05:54:13.038: W/WindowManager(607): 	at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9422)
02-14 05:54:13.038: W/WindowManager(607): 	at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9413)
02-14 05:54:13.038: W/WindowManager(607): 	at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:1807)
02-14 05:54:13.038: W/WindowManager(607): 	at android.os.BinderProxy.sendDeathNotice(Binder.java:688)
02-14 05:54:13.039: I/WindowManager(607): WIN DEATH: null
02-14 05:54:13.111: I/Finsky(17154): [1] com.google.android.finsky.ce.a.onTrimMemory(5): Memory trim requested to level 80
  1. On Nexus 9 while game is on, I tapped on home button directly and got this log
02-14 06:27:02.510: D/Cocos2dxActivity(19001): onPause()
02-14 06:27:02.511: D/Cocos2dxActivity(19001): onPause complete
02-14 06:27:02.559: D/NuPlayerDriver(257): pause(0xe73a0b40)
02-14 06:27:02.559: D/NuPlayerDriver(257): notifyListener_l(0xe73a0b40), (7, 0, 0), loop setting(0, 1)
02-14 06:27:02.561: D/cocos2d-x debug info(19001): Paused called
02-14 06:27:02.580: D/NuPlayerDriver(257): reset(0xe73a0b40) at state 6
02-14 06:27:02.580: D/NuPlayerDriver(257): notifyListener_l(0xe73a0b40), (8, 0, 0), loop setting(0, 1)
02-14 06:27:02.596: W/AMessage(257): failed to post message as target looper for handler 0 is gone.
02-14 06:27:02.600: D/NuPlayerDriver(257): notifyResetComplete(0xe73a0b40)
02-14 06:27:02.689: D/test(19001): OnStop Called
02-14 06:27:02.744: I/ActivityManager(607): Start proc 21151:com.google.android.googlequicksearchbox:search/u0a24 for service com.google.android.googlequicksearchbox/com.google.android.apps.gsa.sidekick.main.remoteservice.NowService
02-14 06:27:02.757: D/NuPlayerDriver(257): notifyListener_l(0xe73a0b40), (1, 0, 0), loop setting(0, 0)
02-14 06:27:02.763: D/MediaPlayer(19001): setSubtitleAnchor in MediaPlayer
02-14 06:27:02.847: I/OpenGLRenderer(1263): Initialized EGL, version 1.4
02-14 06:27:02.847: D/OpenGLRenderer(1263): Swap behavior 2
02-14 06:27:02.865: I/art(607): Background partial concurrent mark sweep GC freed 30301(1338KB) AllocSpace objects, 1(20KB) LOS objects, 33% free, 17MB/26MB, paused 3.908ms total 323.219ms
02-14 06:27:02.904: I/Finsky(19127): [1] com.google.android.finsky.ce.a.onTrimMemory(5): Memory trim requested to level 80

It seems that game gets killed after encountering this error

`

Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer…

But I am puzzled as to why this error comes up only when home button is tapped after recent apps.

Any thoughts based on this log would be highly appreciated.

Thanks.

`

To be honest. I’m happy, that I’m right with the idea that the app was killed, but I have not idea how to help with that.

The ShortcutAndWidgetContainer is something from the launcher. So I don’t believe it has something to do with your game.

We can ask @mozartalouis and @slackmoehrle, maybe they have seen such an issue before.

I have a nexus 9 and I don’t seem to be having issues with apps getting killed.

I actually ran into this exact issue before on my Nexus 9 when I had it.

I don’t remember exactly what I did to solve it, let me see if u can dig it up

1 Like