Android Apps crashing on resume

Discussion in 'Android Development' started by toddw, Mar 15, 2012.

  1. toddw

    toddw

    Member

    Joined:
    May 9, 2010
    Messages:
    102
    So I've got two games where I'm getting frequent crashes when resuming the game from a minimized state.

    One is Dead by Dawn, which has been out on the android marketplace sicne November, and is currently running on unity 3.4

    The other is my current project that have yet to release which is running on the latest build of Unity3.5

    Basically, I can almost consistently reproduce this problem, all I have to do is play the game for a bit, then minimize it in order to access soem other feature in the phone and then click the apps icon again to launch it. Sometimes the app will restore and I can continue to play, but probaly 90% of the time, the app completelely restarts!

    I'm also trying to get Dead by Dawn on the Free app of the Day on Amazon, and they reported the same problem while testing against the Kindle Fire.

    Here are some areas of interest in my logcat reports when the game crashes, any help would be grately appreciated!!



    Dead by Dawn log:

    03-12 10:12:41.650: W/WindowManager(1401): Window freeze timeout expired.
    03-12 10:12:41.650: W/WindowManager(1401): Force clearing orientation change: Window{407e2020 com.LucidVisionGames.DeadByDawn/com.unity3d.player.UnityPlayerActivity paused=false}
    03-12 10:12:41.650: W/WindowManager(1401): Force clearing orientation change: Window{407f36c0 SurfaceView paused=false}
    03-12 10:12:42.845: W/SurfaceFlinger(1401): timeout expired mFreezeDisplay=0, mFreezeCount=1
    03-12 10:12:42.845: W/SurfaceFlinger(1401): timeout expired mFreezeDisplay=0, mFreezeCount=1
    03-12 10:12:43.713: D/dalvikvm(1401): GC_EXPLICIT freed 242K, 50% free 5359K/10567K, external 3552K/4436K, paused 60ms
    03-12 10:12:43.713: D/dalvikvm(1401): GC_EXPLICIT freed 242K, 50% free 5359K/10567K, external 3552K/4436K, paused 60ms
    03-12 10:12:49.236: I/InputDispatcher(1401): Application is not responding: Window{407e2020 com.LucidVisionGames.DeadByDawn/com.unity3d.player.UnityPlayerActivity paused=false}. 5013.4ms since event, 5003.8ms since wait started
    03-12 10:12:49.236: I/Process(1401): Sending signal. PID: 3954 SIG: 3
    03-12 10:12:49.236: I/dalvikvm(3954): threadid=4: reacting to signal 3
    03-12 10:12:49.236: I/WindowManager(1401): Input event dispatching timed out sending to com.LucidVisionGames.DeadByDawn/com.unity3d.player.UnityPlayerActivity
    03-12 10:12:49.236: I/InputDispatcher(1401): Application is not responding: Window{407e2020 com.LucidVisionGames.DeadByDawn/com.unity3d.player.UnityPlayerActivity paused=false}. 5013.4ms since event, 5003.8ms since wait started
    03-12 10:12:49.236: I/Process(1401): Sending signal. PID: 3954 SIG: 3
    03-12 10:12:49.244: I/dalvikvm(3954): Wrote stack traces to '/data/anr/traces.txt'
    03-12 10:12:49.244: I/Process(1401): Sending signal. PID: 1401 SIG: 3
    03-12 10:12:49.244: I/dalvikvm(1401): threadid=4: reacting to signal 3
    03-12 10:12:49.244: I/Process(1401): Sending signal. PID: 1401 SIG: 3
    03-12 10:12:49.244: I/dalvikvm(1401): threadid=4: reacting to signal 3
    03-12 10:12:49.252: I/dalvikvm(1401): Wrote stack traces to '/data/anr/traces.txt'
    03-12 10:12:49.252: I/Process(1401): Sending signal. PID: 1464 SIG: 3
    03-12 10:12:49.252: I/dalvikvm(1464): threadid=4: reacting to signal 3
    03-12 10:12:49.252: I/dalvikvm(1401): Wrote stack traces to '/data/anr/traces.txt'
    03-12 10:12:49.252: I/Process(1401): Sending signal. PID: 1464 SIG: 3
    03-12 10:12:49.252: I/dalvikvm(1464): threadid=4: reacting to signal 3
    03-12 10:12:49.259: I/dalvikvm(1464): Wrote stack traces to '/data/anr/traces.txt'
    03-12 10:12:49.259: I/dalvikvm(1464): Wrote stack traces to '/data/anr/traces.txt'
    03-12 10:12:49.408: D/dalvikvm(1401): GC_EXPLICIT freed 768K, 48% free 5594K/10567K, external 3552K/4436K, paused 58ms
    03-12 10:12:49.408: D/dalvikvm(1401): GC_EXPLICIT freed 768K, 48% free 5594K/10567K, external 3552K/4436K, paused 58ms
    03-12 10:12:49.947: D/InputDispatcher(1401): channel '407e2020 com.LucidVisionGames.DeadByDawn/com.unity3d.player.UnityPlayerActivity (server)' ~ Synthesized 1 cancelation events to bring channel back in sync with reality: application not responding, options=0.
    03-12 10:12:49.947: I/InputDispatcher(1401): Dropping event because the pointer is not down.
    03-12 10:12:49.947: I/InputDispatcher(1401): Dropping event because the pointer is not down.
    03-12 10:12:49.947: I/InputDispatcher(1401): Dropping event because the pointer is not down.
    03-12 10:12:49.947: E/ActivityManager(1401): ANR in com.LucidVisionGames.DeadByDawn (com.LucidVisionGames.DeadByDawn/com.unity3d.player.UnityPlayerActivity)
    03-12 10:12:49.947: E/ActivityManager(1401): Reason: keyDispatchingTimedOut
    03-12 10:12:49.947: E/ActivityManager(1401): Load: 0.92 / 0.96 / 0.86
    03-12 10:12:49.947: E/ActivityManager(1401): CPU usage from 8090ms to 2577ms ago:
    03-12 10:12:49.947: E/ActivityManager(1401): 99% 3954/com.LucidVisionGames.DeadByDawn: 99% user + 0% kernel / faults: 49 minor
    03-12 10:12:49.947: E/ActivityManager(1401): 2.9% 1401/system_server: 1.2% user + 1.6% kernel / faults: 99 minor
    03-12 10:12:49.947: E/ActivityManager(1401): 1% 1481/com.amazon.kindle.otter: 1% user + 0% kernel / faults: 2 minor
    03-12 10:12:49.947: E/ActivityManager(1401): 1% 1925/mediaserver: 1% user + 0% kernel
    03-12 10:12:49.947: E/ActivityManager(1401): 0.7% 7/events/0: 0% user + 0.7% kernel
    03-12 10:12:49.947: E/ActivityManager(1401): 0.1% 8/events/1: 0% user + 0.1% kernel
    03-12 10:12:49.947: E/ActivityManager(1401): 0.1% 1316/adbd: 0% user + 0.1% kernel
    03-12 10:12:49.947: E/ActivityManager(1401): 0% 1400/flush-179:0: 0% user + 0% kernel
    03-12 10:12:49.947: E/ActivityManager(1401): 0.1% 1476/com.android.inputmethod.latin: 0.1% user + 0% kernel / faults: 1 minor
    03-12 10:12:49.947: E/ActivityManager(1401): 52% TOTAL: 51% user + 1.2% kernel + 0% iowait
    03-12 10:12:49.947: E/ActivityManager(1401): CPU usage from 177ms to 696ms later:
    03-12 10:12:49.947: E/ActivityManager(1401): 96% 3954/com.LucidVisionGames.DeadByDawn: 96% user + 0% kernel
    03-12 10:12:49.947: E/ActivityManager(1401): 94% 3962/Thread-10: 94% user + 0% kernel
    03-12 10:12:49.947: E/ActivityManager(1401): 5.7% 1401/system_server: 1.9% user + 3.8% kernel / faults: 1 minor
    03-12 10:12:49.947: E/ActivityManager(1401): 3.8% 1437/InputDispatcher: 1.9% user + 1.9% kernel
    03-12 10:12:49.947: E/ActivityManager(1401): 1.4% 3/ksoftirqd/0: 0% user + 1.4% kernel
    03-12 10:12:49.947: E/ActivityManager(1401): 1.9% 7/events/0: 0% user + 1.9% kernel
    03-12 10:12:49.947: E/ActivityManager(1401): 56% TOTAL: 50% user + 5.7% kernel
    03-12 10:12:49.947: D/InputDispatcher(1401): channel '407e2020 com.LucidVisionGames.DeadByDawn/com.unity3d.player.UnityPlayerActivity (server)' ~ Synthesized 1 cancelation events to bring channel back in sync with reality: application not responding, options=0.
    03-12 10:12:49.947: I/InputDispatcher(1401): Dropping event because the pointer is not down.
    03-12 10:12:49.947: I/InputDispatcher(1401): Dropping event because the pointer is not down.
    03-12 10:12:49.947: I/InputDispatcher(1401): Dropping event because the pointer is not down.
    03-12 10:12:50.205: D/dalvikvm(1401): GC_FOR_MALLOC freed 679K, 48% free 5552K/10567K, external 3770K/4436K, paused 64ms
    03-12 10:12:50.205: D/dalvikvm(1401): GC_FOR_MALLOC freed 679K, 48% free 5552K/10567K, external 3770K/4436K, paused 64ms
    03-12 10:12:50.259: D/dalvikvm(1401): GC_FOR_MALLOC freed 138K, 47% free 5621K/10567K, external 3770K/4436K, paused 57ms
    03-12 10:12:50.259: D/dalvikvm(1401): GC_FOR_MALLOC freed 138K, 47% free 5621K/10567K, external 3770K/4436K, paused 57ms
    03-12 10:12:50.369: D/dalvikvm(1401): GC_FOR_MALLOC freed 233K, 46% free 5731K/10567K, external 3766K/4436K, paused 44ms
    03-12 10:12:50.369: I/dalvikvm-heap(1401): Grow heap (frag case) to 12.108MB for 476570-byte allocation
    03-12 10:12:50.369: D/dalvikvm(1401): GC_FOR_MALLOC freed 233K, 46% free 5731K/10567K, external 3766K/4436K, paused 44ms
    03-12 10:12:50.369: I/dalvikvm-heap(1401): Grow heap (frag case) to 12.108MB for 476570-byte allocation
    03-12 10:12:50.424: D/dalvikvm(1401): GC_FOR_MALLOC freed 0K, 45% free 6196K/11079K, external 3766K/4436K, paused 44ms
    03-12 10:12:50.424: D/dalvikvm(1401): GC_FOR_MALLOC freed 0K, 45% free 6196K/11079K, external 3766K/4436K, paused 44ms
    03-12 10:12:50.478: D/dalvikvm(1401): GC_FOR_MALLOC freed 310K, 47% free 5886K/11079K, external 3766K/4436K, paused 42ms
    03-12 10:12:50.478: I/dalvikvm-heap(1401): Grow heap (frag case) to 12.218MB for 433572-byte allocation
    03-12 10:12:50.478: D/dalvikvm(1401): GC_FOR_MALLOC freed 310K, 47% free 5886K/11079K, external 3766K/4436K, paused 42ms
    03-12 10:12:50.478: I/dalvikvm-heap(1401): Grow heap (frag case) to 12.218MB for 433572-byte allocation
    03-12 10:12:50.525: D/dalvikvm(1401): GC_FOR_MALLOC freed <1K, 46% free 6309K/11527K, external 3766K/4436K, paused 43ms
    03-12 10:12:50.525: D/dalvikvm(1401): GC_FOR_MALLOC freed <1K, 46% free 6309K/11527K, external 3766K/4436K, paused 43ms
    03-12 10:12:51.181: V/DeviceStorageMonitorService(1401): mTotalMemory is 11734999
    03-12 10:12:51.674: W/ActivityManager(1401): Force finishing activity com.LucidVisionGames.DeadByDawn/com.unity3d.player.UnityPlayerActivity
    03-12 10:12:51.681: I/Process(1401): Sending signal. PID: 3954 SIG: 9
    03-12 10:12:51.681: I/ActivityManager(1401): Killing com.LucidVisionGames.DeadByDawn (pid=3954): user's request
    03-12 10:12:51.681: I/Process(1401): Sending signal. PID: 3954 SIG: 9
    03-12 10:12:51.720: V/AmazonAppstore.MASContentProvider/ImageDownloadQueue(1652): Image download queue empty, waiting.
    03-12 10:12:51.736: E/InputDispatcher(1401): channel '407e2020 com.LucidVisionGames.DeadByDawn/com.unity3d.player.UnityPlayerActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x8
    03-12 10:12:51.736: E/InputDispatcher(1401): channel '407e2020 com.LucidVisionGames.DeadByDawn/com.unity3d.player.UnityPlayerActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
    03-12 10:12:51.736: I/WindowManager(1401): WINDOW DIED Window{407e2020 com.LucidVisionGames.DeadByDawn/com.unity3d.player.UnityPlayerActivity paused=true}
    03-12 10:12:51.736: I/ActivityManager(1401): Process com.LucidVisionGames.DeadByDawn (pid 3954) has died.
    03-12 10:12:51.736: E/InputDispatcher(1401): channel '407e2020 com.LucidVisionGames.DeadByDawn/com.unity3d.player.UnityPlayerActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x8
    03-12 10:12:51.736: E/InputDispatcher(1401): channel '407e2020 com.LucidVisionGames.DeadByDawn/com.unity3d.player.UnityPlayerActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
    03-12 10:12:51.744: I/WindowManager(1401): WIN DEATH: Window{407f36c0 SurfaceView paused=false}
    03-12 10:12:51.744: I/WindowManager(1401): WIN DEATH: Window{407e2020 com.LucidVisionGames.DeadByDawn/com.unity3d.player.UnityPlayerActivity paused=true}
    03-12 10:12:51.752: I/AmazonLauncher.Launcher(1481): onDestroy
    03-12 10:12:51.752: I/AmazonLauncher.OtterActivity(1481): OnDestroy
    03-12 10:12:51.752: D/AmazonLauncher.SurfaceView(1481): shutting down
    03-12 10:12:51.752: D/AmazonLauncher.RenderTask(1481): RENDERER CLEAN SHUT DOWN
    03-12 10:12:51.752: D/AmazonLauncher.OverlayManager(1481): Hide current overlay (null)
    03-12 10:12:51.752: I/AmazonLauncher.HomeLibrary(1481): onPause
    03-12 10:12:51.752: I/AmazonLauncher.Library(1481): onPause
    03-12 10:12:51.752: I/AmazonLauncher.HomeLibrary(1481): onDestroy



    Celestial log:


    E/ ( 228): onResume() check 5
    D/Warhol ( 228): Skip Installer by Warhol is false or Test Mode is false
    I/Launcher( 228): onResume() ended
    V/Launcher.Workspace( 228): onSizeChanged( 480,800,480,762)getWidth() = 480getH
    eight() = 800
    I/Launcher( 228): onWindowFocusChanged(true)
    D/Launcher( 228): It's image wallpaper. suggestDesiredDimensions(-1,-1)
    E/Launcher( 228): setWindowOpaque()
    D/szipinf ( 202): Initializing inflate state
    D/dalvikvm( 202): GC_FOR_MALLOC freed 1330K, 59% free 3024K/7367K, external 650
    4K/8083K, paused 34ms
    W/IInputConnectionWrapper(13491): showStatusIcon on inactive InputConnection
    D/szipinf ( 202): Initializing zlib to inflate
    V/StatusBar( 108): Showing status bar panel[1]
    V/StatusBar( 108): Showing status bar panel[0]
    V/Launcher.Workspace( 228): onSizeChanged( 480,762,480,800)getWidth() = 480getH
    eight() = 762
    D/dalvikvm( 108): GC_EXPLICIT freed 76K, 44% free 8046K/14279K, external 3697K/
    4617K, paused 123ms
    I/InputReader( 108): dispatchTouch::touch event's action is 0
    I/InputDispatcher( 108): Delivering touch to current input target: action: 0, c
    hannel '40949e90 com.sec.android.app.twlauncher/com.sec.android.app.twlauncher.L
    auncher (server)'
    I/InputReader( 108): dispatchTouch::touch event's action is 1
    I/InputDispatcher( 108): Delivering touch to current input target: action: 1, c
    hannel '40949e90 com.sec.android.app.twlauncher/com.sec.android.app.twlauncher.L
    auncher (server)'
    V/AudioFlinger( 73): createTrack() sessionId: 0
    V/AudioFlinger( 73): createTrack() lSessionId: 1164
    V/AudioFlinger( 73): Track constructor name 4103, calling thread 108
    V/AudioFlinger( 73): start(4103), calling thread 108 session 1164
    V/AudioFlinger( 73): ? => ACTIVE (4103) on thread 0x17eb8
    V/AudioPolicyManager( 73): startOutput() output 1, stream 1, session 1164
    V/AudioPolicyManager( 73): getDeviceForStrategy() from cache strategy 0, devic
    e 2
    V/AudioPolicyManager( 73): getDeviceForStrategy() from cache strategy 0, devic
    e 2
    V/AudioPolicyManager( 73): getNewDevice() selected device 2
    V/AudioPolicyManager( 73): setOutputDevice() output 1 device 2 delayMs 0 force
    0
    V/AudioPolicyManager( 73): setOutputDevice() setting same device 2 or null dev
    ice for output 1
    V/AudioFlinger( 73): mWaitWorkCV.broadcast
    V/AudioPolicyManager( 73): releaseOutput() 1
    V/AudioFlinger( 73): remove track (4099) and delete from mixer
    V/AudioFlinger( 73): PlaybackThread::Track destructor
    D/SamsungUtils( 228): acquireDVFSlock arg0 : 0 arg1 : 1000
    I/power ( 108): acquire_dvfs_lock level=0
    I/power ( 108): acquire_dvfs_lock level=0, duration=1000, val=1000
    D/PowerManagerService( 108): acquireDVFSlock : level : 0, timeMS : 1000
    I/Launcher( 228): onPause()
    I/ActivityManager( 108): Start proc com.rechild.advancedtaskkiller for activity
    com.rechild.advancedtaskkiller/.AdvancedTaskKiller: pid=13564 uid=10078 gids={3
    003, 1015}
    I/Launcher( 228): onWindowFocusChanged(false)
    D/Launcher( 228): It's image wallpaper. suggestDesiredDimensions(-1,-1)
    I/webclipboard(13564): clipservice: android.sec.clipboard.ClipboardExManager@405
    25e70
    V/AudioFlinger( 73): stop(4103), calling thread 108
    V/AudioFlinger( 73): (> STOPPED) => STOPPED (4103) on thread 0x2f690
    V/AudioPolicyManager( 73): stopOutput() output 1, stream 1, session 1164
    V/AudioPolicyManager( 73): getNewDevice() selected device 0
    V/AudioPolicyManager( 73): setOutputDevice() output 1 device 0 delayMs 0 force
    0
    V/AudioPolicyManager( 73): setOutputDevice() setting same device 0 or null dev
    ice for output 1
    D/BatteryService( 108): update start
    D/BatteryService( 108): updateBattery level:59 scale:100 status:2 health:2 pres
    ent:true voltage: 3961 temperature: 320 technology: Li-ion AC powered:false USB
    powered:true icon:17302217
    V/NotificationService( 108): notification manager receiver action = android.int
    ent.action.BATTERY_CHANGED
    D/SyncmlService( 211): mBatteryReceiver: action - android.intent.action.BATTERY
    _CHANGED
    I/StatusBarPolicy( 194): BAT. S:2 H:2
    V/AudioFlinger( 73): TrackBase::reset
    D/WML_SISO(13564): InitPasteboardJni
    D/dalvikvm(13564): GC_EXTERNAL_ALLOC freed 115K, 45% free 3077K/5575K, external
    2091K/2108K, paused 25ms
    I/ActivityManager( 108): Displayed com.rechild.advancedtaskkiller/.AdvancedTask
    Killer: +2s33ms
    D/NotificationService( 108): enqueueNotification :: notification.defaults = 0,
    Notification.DEFAULT_SOUND = 1, notification.sound = null pag com.rechild.advanc
    edtaskkiller
    W/webcore (13564): Can't get the viewWidth after the first layout
    D/OSNetworkSystem(13564): check_slot0_groups num = 2
    D/OSNetworkSystem(13564): check_slot0_groups ret = 1
    I/StatusBarPolicy( 194): onDataActivity-D:0
    V/AudioFlinger( 73): Audio hardware entering standby, mixer 0x2f690, mSuspende
    d 0
    D/AudioHardwareALSA( 73): Inside AudioStreamOutALSA::standby
    V/AudioHardwareALSA( 73): ALSAStreamOps::close()
    I/AudioHardwareALSA( 73): Output standby called!!. Turn off PCM device.
    V/AudioFlinger( 73): MixerThread 0x2f690 TID 103 going to sleep
    D/InputReader( 108): Input event: value=1
    I/ScreenCaptureAction( 108): isBackKeyPressed(), return value = false
    V/WindowManager( 108): in isSystemKeyEventRequested() return value is false
    D/InputReader( 108): Input event: value=0
    I/ScreenCaptureAction( 108): isBackKeyPressed(), return value = false
    D/StatusBarService( 194): animateCollapse() - updateViewLayout
    I/Launcher( 228): onResume(). mIsNewIntent : true
    E/ ( 228): onResume() check 0
    E/ ( 228): onResume() check 1
    E/Launcher( 228): setWindowOpaque()
    E/ ( 228): onResume() check 2, mRestoring : false
    E/ ( 228): onResume() check 3
    E/ ( 228): onResume() check 4
    E/ ( 228): onResume() check 5
    D/Warhol ( 228): Skip Installer by Warhol is false or Test Mode is false
    I/Launcher( 228): onResume() ended
    D/OSNetworkSystem(13564): check_slot0_groups num = 2
    D/OSNetworkSystem(13564): check_slot0_groups ret = 1
    D/szipinf ( 202): Initializing inflate state
    D/szipinf ( 202): Initializing zlib to inflate
    I/StatusBarPolicy( 194): onDataActivity-D:3
    W/webcore (13564): Can't get the viewWidth after the first layout
    V/webview (13564): OnSizeChanged: Enter
    I/Launcher( 228): onWindowFocusChanged(true)
    D/Launcher( 228): It's image wallpaper. suggestDesiredDimensions(-1,-1)
    E/Launcher( 228): setWindowOpaque()
    W/InputManagerService( 108): Starting input on non-focused client com.android.i
    nternal.view.IInputMethodClient$Stub$Proxy@4097a160 (uid=10078 pid=13564)
    I/ActivityManager( 108): Process com.LucidVisionGames.Celestial (pid 13491) has
    died.
    I/WindowManagerService( 108): WIN DEATH: Window{40ac5c90 SurfaceView paused=fal
    se}
    V/AudioFlinger( 73): removeNotificationClient() 0x81828, pid 13491
    V/AudioPolicyManager( 73): releaseOutput() 1
    V/AudioFlinger( 73): remove track (4102) and delete from mixer
    V/AudioFlinger( 73): PlaybackThread::Track destructor
    V/AudioFlinger( 73): removeClient_l() pid 13491, tid 104, calling tid 73
    I/WindowManagerService( 108): WIN DEATH: Window{4096e4e8 com.LucidVisionGames.C
    elestial/com.unity3d.player.UnityPlayerActivity paused=false}
    I/StatusBarPolicy( 194): onDataActivity-D:0
    I/InputReader( 108): dispatchTouch::touch event's action is 0
    I/InputDispatcher( 108): Delivering touch to current input target: action: 0, c
    hannel '40949e90 com.sec.android.app.twlauncher/com.sec.android.app.twlauncher.L
    auncher (server)'
    I/InputReader( 108): dispatchTouch::touch event's action is 1
    I/InputDispatcher( 108): Delivering touch to current input target: action: 1, c
    hannel '40949e90 com.sec.android.app.twlauncher/com.sec.android.app.twlauncher.L
    auncher (server)'
    D/SamsungUtils( 228): acquireDVFSlock arg0 : 0 arg1 : 1000
    D/PowerManagerService( 108): acquireDVFSlock : level : 0, timeMS : 1000
    I/power ( 108): acquire_dvfs_lock level=0
    I/power ( 108): acquire_dvfs_lock level=0, duration=1000, val=1000
    V/AudioFlinger( 73): createTrack() sessionId: 0
    V/AudioFlinger( 73): createTrack() lSessionId: 1165
    V/AudioFlinger( 73): Track constructor name 4099, calling thread 108
    V/AudioFlinger( 73): start(4099), calling thread 108 session 1165
    V/AudioFlinger( 73): ? => ACTIVE (4099) on thread 0x24658
    V/AudioPolicyManager( 73): startOutput() output 1, stream 1, session 1165
    V/AudioPolicyManager( 73): getDeviceForStrategy() from cache strategy 0, devic
    e 2
    V/AudioPolicyManager( 73): getDeviceForStrategy() from cache strategy 0, devic
    e 2
    V/AudioPolicyManager( 73): getNewDevice() selected device 2
    V/AudioPolicyManager( 73): setOutputDevice() output 1 device 2 delayMs 0 force
    0
    V/AudioPolicyManager( 73): setOutputDevice() setting same device 2 or null dev
    ice for output 1
    V/AudioFlinger( 73): mWaitWorkCV.broadcast
    V/AudioFlinger( 73): MixerThread 0x2f690 TID 103 waking up
    V/AudioFlinger( 73): anticipated start
    D/AudioHardwareALSA( 73): Calling setDevice from write @..1892.
    V/AudioPolicyManager( 73): releaseOutput() 1
    V/AudioFlinger( 73): remove track (4103) and delete from mixer
    V/AudioFlinger( 73): PlaybackThread::Track destructor
    I/Launcher( 228): onPause()
    I/ActivityManager( 108): Start proc com.LucidVisionGames.Celestial for activity
    com.LucidVisionGames.Celestial/com.unity3d.player.UnityPlayerActivity: pid=1359
    1 uid=10107 gids={3003}
    I/AudioHardwareALSA( 73): Initialized ALSA PLAYBACK device AndroidPlayback_Spe
    aker_normal
    V/AudioHardwareALSA( 73): Set PLAYBACK PCM format to S16_LE (Signed 16 bit Lit
    tle Endian)
    D/AudioHardwareALSA( 73): Using 2 channels for PLAYBACK.
    I/AudioHardwareALSA( 73): DEFAULT_SAMPLE_RATE is 44100, mDefaults->sampleRate
    is 44100
    D/AudioHardwareALSA( 73): Set PLAYBACK sample rate to 44100 HZ
    D/AudioHardwareALSA( 73): Buffer size: 4096
    D/AudioHardwareALSA( 73): Latency: 92879
    W/AudioFlinger( 73): write blocked for 148 msecs, 285 delayed writes, thread 0
    x2f690
    I/WindowManagerService( 108): Setting rotation to 1, animFlags=1
    I/ActivityManager( 108): Config changed: { scale=1.0 imsi=310/120 loc=en_US tou
    ch=3 keys=2/1/2 nav=1/1 orien=2 layout=34 uiMode=17 seq=74 FlipFont=0}
    D/PhoneApp( 211): updateProximitySensorMode: state = IDLE
    D/PhoneApp( 211): updateProximitySensorMode: lock already released.
    I/Launcher( 228): onWindowFocusChanged(false)
    D/OPPBaseService(13519): [main/1] onConfigurationChanged()
    D/dalvikvm(13591): Trying to load lib /mnt/asec/com.LucidVisionGames.Celestial-2
    /lib/libmono.so 0x405148b0
    D/dalvikvm(13591): Added shared lib /mnt/asec/com.LucidVisionGames.Celestial-2/l
    ib/libmono.so 0x405148b0
    V/AudioFlinger( 73): stop(4099), calling thread 108
    V/AudioFlinger( 73): (> STOPPED) => STOPPED (4099) on thread 0x2f690
    V/AudioPolicyManager( 73): stopOutput() output 1, stream 1, session 1165
    V/AudioPolicyManager( 73): getNewDevice() selected device 0
    V/AudioPolicyManager( 73): setOutputDevice() output 1 device 0 delayMs 0 force
    0
    V/AudioPolicyManager( 73): setOutputDevice() setting same device 0 or null dev
    ice for output 1
    D/Launcher( 228): It's image wallpaper. suggestDesiredDimensions(-1,-1)
    V/AudioFlinger( 73): TrackBase::reset
    D/proxy (13591): Added shared lib /assets/libs/armeabi-v7a/libmono.so 0x8121cf
    4c
    D/proxy (13591): No JNI_OnLoad found in /assets/libs/armeabi-v7a/libmono.so 0x
    8121cf4c
    D/dalvikvm(13591): Trying to load lib /mnt/asec/com.LucidVisionGames.Celestial-2
    /lib/libunity.so 0x405148b0
    D/dalvikvm(13591): Added shared lib /mnt/asec/com.LucidVisionGames.Celestial-2/l
    ib/libunity.so 0x405148b0
    D/proxy (13591): Added shared lib /assets/libs/armeabi-v7a/libunity.so 0x81312
    f4c
    I/GLThread(13591): noticed surfaceView surface lost tid=9
    D/SensorManager(13591): ====>>>>>Num Sensor: 1
    D/SensorManager(13591): ====>>>>>Num Sensor: 2
    D/SensorManager(13591): ====>>>>>Num Sensor: 3
    D/SensorManager(13591): ====>>>>>Num Sensor: 4
    D/SensorManager(13591): ====>>>>>Num Sensor: 5
    D/SensorManager(13591): ====>>>>>Num Sensor: 6
    D/SensorManager(13591): ====>>>>>Num Sensor: 7
    D/SensorManager(13591): ====>>>>>Num Sensor: 0
    I/GLThread(13591): onResume tid=9
    E/SensorManager(13591): registerListener :: handle = 0 name= BMA023 Acceleratio
    n Sensor delay= 20000 Listener= com.unity3d.player.h@40574ad8
    E/SensorManager(13591): =======>>>Sensor Thread RUNNING <<<========
    E/SensorManager(13591): reg :: handle = 0
    E/SensorManager(13591): registerListener :: handle = 1 name= MS-3C Magnetic Sen
    sor delay= 20000 Listener= com.unity3d.player.h@40574ad8
    E/SensorManager(13591): reg :: handle = 1
    I/ActivityManager( 108): Displayed com.LucidVisionGames.Celestial/com.unity3d.p
    layer.UnityPlayerActivity: +1s445ms
    I/GLThread(13591): noticed surfaceView surface acquired tid=9
    W/EglHelper(13591): start() tid=9
    V/StatusBar( 108): Hiding status bar panel[1]
    V/StatusBar( 108): Hiding status bar panel[0]
    V/StatusBar( 108): collapse
    D/StatusBarService( 194): animateCollapse() - updateViewLayout
    D/StatusBarService( 194): animateCollapse() - updateViewLayout
    W/IInputConnectionWrapper( 228): showStatusIcon on inactive InputConnection
    D/libEGL (13591): loaded /system/lib/egl/libEGL_POWERVR_SGX540_120.so
    D/libEGL (13591): loaded /system/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
    D/libEGL (13591): loaded /system/lib/egl/libGLESv2_POWERVR_SGX540_120.so
    D/Unity (13591): Creating OpenGL ES 2.0 context (RGB16 565 24/8)
    W/EglHelper(13591): createContext com.google.android.gles_jni.EGLContextImpl@405
    85050 tid=9
    I/GLThread(13591): noticing that we want render notification tid=9
    W/GLThread(13591): egl createSurface
    W/EglHelper(13591): createSurface() tid=9
    W/GLThreadManager(13591): checkGLESVersion mGLESVersion = 131072 mMultipleGLESCo
    ntextsAllowed = true
    W/GLThread(13591): onSurfaceCreated
    W/GLThread(13591): onSurfaceChanged(800, 480)
    I/GLThread(13591): sending render notification tid=9
    V/AudioPolicyManager( 73): getDeviceForStrategy() from cache strategy 0, devic
    e 2
    V/AudioPolicyManager( 73): getOutput() stream 3, samplingRate 0, format 0, cha
    nnels c, flags 0
    V/AudioFlinger( 73): registerClient() client 0x6e5c0, pid 13591
    V/AudioFlinger( 73): sendConfigEvent() num events 1 event 0, param 0
    V/AudioFlinger( 73): processConfigEvents() remaining events 1
    V/AudioFlinger( 73): PlaybackThread::audioConfigChanged_l, thread 0x2f690, eve
    nt 0, param 0
    V/AudioFlinger( 73): createTrack() sessionId: 0
    V/AudioFlinger( 73): createTrack() lSessionId: 1166
    V/AudioFlinger( 73): Track constructor name 4102, calling thread 13591
    V/AudioFlinger( 73): start(4102), calling thread 13591 session 1166
    V/AudioFlinger( 73): ? => ACTIVE (4102) on thread 0x26d60
    V/AudioPolicyManager( 73): startOutput() output 1, stream 3, session 1166
    V/AudioPolicyManager( 73): getDeviceForStrategy() from cache strategy 0, devic
    e 2
    V/AudioPolicyManager( 73): getDeviceForStrategy() from cache strategy 0, devic
    e 2
    V/AudioPolicyManager( 73): getNewDevice() selected device 2
    V/AudioPolicyManager( 73): setOutputDevice() output 1 device 2 delayMs 0 force
    0
    V/AudioPolicyManager( 73): setOutputDevice() setting same device 2 or null dev
    ice for output 1
    V/AudioFlinger( 73): mWaitWorkCV.broadcast
    I/StatusBarPolicy( 194): onDataActivity-D:3
    D/dalvikvm( 108): GC_EXPLICIT freed 179K, 44% free 8066K/14279K, external 3697K
    /4617K, paused 96ms
    D/BatteryService( 108): update start
    D/BatteryService( 108): updateBattery level:59 scale:100 status:2 health:2 pres
    ent:true voltage: 3846 temperature: 320 technology: Li-ion AC powered:false USB
    powered:true icon:17302217
    D/SyncmlService( 211): mBatteryReceiver: action - android.intent.action.BATTERY
    _CHANGED
    V/NotificationService( 108): notification manager receiver action = android.int
    ent.action.BATTERY_CHANGED
    I/StatusBarPolicy( 194): BAT. S:2 H:2
    I/StatusBarPolicy( 194): onDataActivity-D:0
    I/StatusBarPolicy( 194): onDataActivity-D:3
    W/PowerManagerService( 108): Timer 0x7->0x3|0x0
    I/PowerManagerService( 108): Ulight 7->3|0
    D/PowerManagerService( 108): updateLightsLocked: onMask=0 offMask=4 dimMask=0
    D/LightsService( 108): BUTTON : 0
     
  2. toddw

    toddw

    Member

    Joined:
    May 9, 2010
    Messages:
    102
    Anyone???
     
  3. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Messages:
    11,518
    Can you not run it from unity with debugger attached?
     
  4. Tseng

    Tseng

    Member

    Joined:
    Nov 29, 2010
    Messages:
    1,215
    What's the RAM of your device and how much RAM does your game use (while in level not inside some menu)?

    If the your game/app is very memory intensive, then you go back to desktop, start a new app, Android will kill any "sleeping" processes (processes of apps which are in background), to release memory. This could be one thing that happens. Does it also happens, if you just go to the background and resume immediately? Or only after you started another App?

    The issue is, that when you hit the back buttont he active Activity/App is put in sleep mode and and Android manages the memory itself. If there is enough memory available for the new app to launch, nothing will happend and you can easily resume. If not, Android will kill some of the sleeping processes to release memory.

    In normal Android Apps you usually have a lifecycle. When the Activity is started for the first time,
    * onCreate method (of your Activity class) gets called. There you usually initialize your app UI etc. It gets a bundle passed. On first start this bundle is null. It can be used to pass parameters for restarting apps (after the app has been killed by the system in order to resume the app previous state)
    * onStart method is called next. This is called after onCreate or after the app has been restarted (oriantaion change, being killed before etc.)
    * onResume method. This is called after onStart or when then Activity comes into the foreground.
    * onPause method, this is called before the app goes to the background (when another app is about to be shown or when the app is being minimized
    * onStop method, is called when the activity is no longer visible (i.e. after the desktop or the new Activity has been shown)
    * onDestroy method when the app is about to being destroyed by the Android OS to release memory for other Activities

    Typically Android developers are encouraged to save any important data in the when "onPause" is being called in a Bundle (some kind of Dictionary/HashList/KeyValue list). Also the developers are advised to release memory here (i.e stop the GPS service, close any opened files, internet connections etc.) and resume them at "onResume".

    If the app happens to get killed, onCreate method will be created and the bundle will be passed (which you created/saved at onPause/onStop methods) and this can be used to bring the App in it's previous state (i.e. bring back input in the fields the user has typed in etc.).

    This is important for a reason: The App (and the developer) never know whether or not their app will be killed by the system and when, so the App developer must save this data at the earlierst possible point (which is when onPause happens) in order prevent data loss.

    Now with Unity3D, this is different, because Unity do not necessary implement this kind of lifecycle (it has OnApplicationFocus/OnApplicationPause/OnApplicationQuit in MonoBehaviour), but there is no native way to pass stuff into the bundle and read it from the bundle, so you rather have to implement this yourself (i.e. save the games state on Pause and load it on resume)
     
  5. toddw

    toddw

    Member

    Joined:
    May 9, 2010
    Messages:
    102
    Wow, thanks for the thorough breakdown. That sounds about right, my game was getting performance issues when i added rapidly played sound effects "bullet shots" so I changed any audio files that affected performance to "load in memory", so I'm sure its a matter of memory usage. In addition, the app does not die if I send to back for a second or two and resume, but if I leave it for a while or open something else it will.

    According to the FAD review team "Accessing the device settings or hibernating the device results in the app hanging and/or force closing".

    I'm not really sure what can be done to resolve this, I mean, I can't exactly unload the mp3 files from memory then reload them on resume, can i?
     
  6. toddw

    toddw

    Member

    Joined:
    May 9, 2010
    Messages:
    102
    Thanks for the response, I don't have Unity pro so I unfortunately cannot.
     
  7. valdelievre

    valdelievre

    New Member

    Joined:
    Mar 10, 2012
    Messages:
    23
    Hello,

    Did anyone find the issue ?
    I looks like i have the same problem.

    - I have also tried to remove ALL the object of my scene and it turns out that i have the same problem, even with no game object, no script...
    -When i tick development build and press 'power button" to lock my screen, it does not show my lock screen but just turn off the screen. If i turn my screen on again, my game is correctly resumed
    - I am using Unity 3.5.6f4. I have tried with the latest Unity 3.5.7, same problem
    - Default orientation = Landscape Left
    - I have compiled another project ( with almost zero assets ), i dont have the problem.

    It looks to be related to the asset(maybe shaders used?) that i have + maybe some project settings


    Edit : Toddw, i have downloaded DeadByDawnLite, and it seems you are still experiencing the problem ( at least on my galaxy S2 )
    W/InputDispatcher( 1990): channel '420ce360 com.LucidVisionGames.DeadByDawnLite/com.unity3d.player.UnityPlayerActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x8

    STEP to reproduce :
    I'm playing to my game and decide to lock the screen ( power button ).
    When i delock the screen, i'm expecting to have my game resumed, but nothing, it stays on the home screen
    I have noticed the following in the logs :

    D/WallpaperWidget( 1990): cleanUp()
    W/InputDispatcher( 1990): channel '419bda98 com.overflowstudio.gravitysheep.free/com.unity3d.player.UnityPlayerActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x8
    E/InputDispatcher( 1990): channel '419bda98 com.overflowstudio.gravitysheep.free/com.unity3d.player.UnityPlayerActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

    D/dalvikvm( 1990): GC_FOR_ALLOC freed 71K, 31% free 27529K/39687K, paused 73ms
    I/dalvikvm-heap( 1990): Grow heap (frag case) to 29.871MB for 3072016-byte allocation
    D/dalvikvm( 1990): GC_FOR_ALLOC freed 12K, 24% free 30517K/39687K, paused 70ms
    W/InputDispatcher( 1990): Attempted to unregister already unregistered input channel '419bda98 com.overflowstudio.gravitysheep.free/com.unity3d.player.UnityPlayerActivity (server)'
    I/WindowManager( 1990): WINDOW DIED Window{419bda98 com.overflowstudio.gravitysheep.free/com.unity3d.player.UnityPlayerActivity paused=false}
    I/SurfaceFlinger( 1820): id=2514 Removed idx=2 Map Size=4
    I/SurfaceFlinger( 1820): id=2514 Removed idx=-2 Map Size=4
    D/DigitalClock( 4434): DigitalClockAppWidgetService. action : android.intent.action.CONFIGURATION_CHANGED
    D/CircleLockScreen( 1990): onPause()
    D/CircleMissedEventWidget( 1990): onPause()
    D/CircleLockScreen( 1990): cleanUp()
    I/power ( 1990): *** acquire_dvfs_lock : lockType : 1 freq : 1200000
    I/ActivityManager( 1990): Process com.overflowstudio.gravitysheep.free (pid 5957) has died.
    D/PowerManagerService( 1990): acquireDVFSLockLocked : type : DVFS_MIN_LIMIT frequency : 1200000 uid : 1000 pid : 1990 tag : ActivityManager
    W/ActivityManager( 1990): mDVFSLock.acquire()
    W/WindowManager( 1990): Failed looking up window
    W/WindowManager( 1990): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@419ff3b0 does not exist
    W/WindowManager( 1990): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7504)
    W/WindowManager( 1990): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7495)
    W/WindowManager( 1990): at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:1532)
    W/WindowManager( 1990): at android.os.BinderProxy.sendDeathNotice(Binder.java:417)
    W/WindowManager( 1990): at dalvik.system.NativeStart.run(Native Method)
    I/WindowManager( 1990): WIN DEATH: win
    D/CircleMissedEventWidget( 1990): cleanUp()
    I/ActivityManager( 1990): Start proc app.processName for activity hostingNameStr: pid=6129 uid=10142 gids={3003}


    Manifest.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <manifest android:versionCode="8" android:versionName="1.2.6" android:installLocation="preferExternal" package="com.overflowstudio.gravitysheep.free"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <supports-screens android:anyDensity="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" />
    <application android:label="@string/app_name" android:icon="@drawable/app_icon" android:debuggable="false">
    <activity android:label="@string/app_name" android:name="com.unity3d.player.UnityPlayerActivity" android:screenOrientation="landscape" android:configChanges="keyboard|keyboardHidden|orientation">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>
    <activity android:label="@string/app_name" android:name="com.unity3d.player.VideoPlayer" android:screenOrientation="landscape" android:configChanges="keyboard|keyboardHidden|orientation" />
    <intent-filter>
    <action android:name="com.android.vending.billing.IN_APP_NOTIFY" />
    <action android:name="com.android.vending.billing.RESPONSE_CODE" />
    <action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" />
    </intent-filter>
    </receiver>
    </application>
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="com.android.vending.BILLING" />
    <uses-feature android:glEsVersion="131072" />
    <uses-feature android:name="android.hardware.touchscreen" />
    <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
    <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" />
    </manifest>

    If anyone has a hint, i would be really grateful
     
    Last edited: Jan 3, 2013
  8. valdelievre

    valdelievre

    New Member

    Joined:
    Mar 10, 2012
    Messages:
    23
    SOLVED ! ( at least for me )

    I had a plugin overriding the manifest.xml located in [yourproject]\plugins\android\AndroidManifest.xml
    By removing the file, i was not experiencing any problem anymore

    Hope it will help some of you

    Cheers
     
  9. JoshOClock

    JoshOClock

    Member

    Joined:
    Dec 8, 2010
    Messages:
    104
    I believe this problem is caused by this:
    http://developer.android.com/guide/topics/manifest/activity-element.html
    android:configChanges
    Lists configuration changes that the activity will handle itself. When a configuration change occurs at runtime, the activity is shut down and restarted by default, but declaring a configuration with this attribute will prevent the activity from being restarted. Instead, the activity remains running and its onConfigurationChanged() method is called.


    I've seen this on Phones and seems to be when the device is changing orientation and/or screen size which makes your app restart/crash.

    If you let Unity generate the AndroidManifest.xml it will put the appropriate elements in for you and your app shouldn't crash or restart.
     
  10. Sleepyeyes

    Sleepyeyes

    New Member

    Joined:
    Apr 25, 2013
    Messages:
    2
    The Ram in your device might me low.
     
  11. mmorcc

    mmorcc

    New Member

    Joined:
    Oct 22, 2013
    Messages:
    11
    I have the problem in use the problem with the configs android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale" 不能打汉字吗
     
  12. rico005

    rico005

    New Member

    Joined:
    Jan 2, 2014
    Messages:
    1
    this is the right one, I have sloved problem by this method!
     
  13. Evil-Dog

    Evil-Dog

    Member

    Joined:
    Oct 4, 2011
    Messages:
    118
    Any more thoughts on this? None of the solutions seem to apply to me, my game used to work and now with the new versions I do, I get those crashes when resuming the games I make.