Apps crash on Android 11

Hi everyone!

I developed some apps a while ago with Defold. I wonder if there is anything new with Android 11? My apps suddenly crash with Android 11 at soon as I click the app icon. Android 10 and iOS versions are working normally.

Any help would be appreciate!!

Thanks so much.

Hi @hungle !

Have you checked the output in the adb logcat.
I expect there to be some details about your crash.

More info: Defold development for the Android platform

Hi!

Thanks for helping me!

It’s strange that when I install the app directly from the .apk bundle file, it started normally on the emulator. However, install the same .apk from Play Store, it crashes at open.

With adb logcat, I only see this error (but the app run normally):

E defold : ERROR:PROFILER: Could not open /proc/stat

I’m not sure what happened, is there anything clue?

That’s not a fatal error.
Don’t use “-s Defold” with adb, it will only list lines with the word Defold in it.

Instead make sure to use the full log:

adb logcat
2 Likes

I think it is this section of the log that indicate the app dies?

(I have no idea how to read it though)

01-06 17:05:41.162  7198  7225 V glfw-android: Not on main thread, skipping.
01-06 17:05:41.169   304   304 W EmuHWC2 : validate: layer 37 CompositionType 1, fallback
01-06 17:05:41.171   304   304 W EmuHWC2 : No layers, exit, buffer 0xb4000076c06c6190
01-06 17:05:41.179   496   582 W InputDispatcher: channel 'bec9a77 com.samplecompany.samplegame/com.dynamo.android.DefoldActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
01-06 17:05:41.179   496   582 E InputDispatcher: channel 'bec9a77 com.samplecompany.samplegame/com.dynamo.android.DefoldActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-06 17:05:41.179   289   289 I Zygote  : Process 7198 exited cleanly (1)
01-06 17:05:41.179   496  1390 I ActivityManager: Process com.samplecompany.samplegame (pid 7198) has died: fg  TOP 
01-06 17:05:41.180   496   527 I libprocessgroup: Successfully killed process cgroup uid 10173 pid 7198 in 0ms
01-06 17:05:41.180   496  6715 I WindowManager: WIN DEATH: Window{bec9a77 u0 com.samplecompany.samplegame/com.dynamo.android.DefoldActivity}
01-06 17:05:41.180   496  6715 W InputDispatcher: Attempted to unregister already unregistered input channel 'bec9a77 com.samplecompany.samplegame/com.dynamo.android.DefoldActivity (server)'
01-06 17:05:41.180   496  6715 W WindowManager: Failed to deliver inset state change to w=Window{bec9a77 u0 com.samplecompany.samplegame/com.dynamo.android.DefoldActivity EXITING}
01-06 17:05:41.180   496  6715 W WindowManager: android.os.DeadObjectException
01-06 17:05:41.180   496  6715 W WindowManager:     at android.os.BinderProxy.transactNative(Native Method)
01-06 17:05:41.180   496  6715 W WindowManager:     at android.os.BinderProxy.transact(BinderProxy.java:540)
01-06 17:05:41.180   496  6715 W WindowManager:     at android.view.IWindow$Stub$Proxy.insetsControlChanged(IWindow.java:765)
01-06 17:05:41.180   496  6715 W WindowManager:     at com.android.server.wm.WindowState.notifyInsetsControlChanged(WindowState.java:3670)
01-06 17:05:41.180   496  6715 W WindowManager:     at com.android.server.wm.InsetsStateController.lambda$notifyPendingInsetsControlChanged$4$InsetsStateController(InsetsStateController.java:445)
01-06 17:05:41.180   496  6715 W WindowManager:     at com.android.server.wm.-$$Lambda$InsetsStateController$-1iOXDf-1s3wDHcMIHBKNk6MS3I.run(Unknown Source:2)
01-06 17:05:41.180   496  6715 W WindowManager:     at com.android.server.wm.WindowAnimator.executeAfterPrepareSurfacesRunnables(WindowAnimator.java:341)
01-06 17:05:41.180   496  6715 W WindowManager:     at com.android.server.wm.RootWindowContainer.performSurfacePlacementNoTrace(RootWindowContainer.java:854)
01-06 17:05:41.180   496  6715 W WindowManager:     at com.android.server.wm.RootWindowContainer.performSurfacePlacement(RootWindowContainer.java:802)
01-06 17:05:41.180   496  6715 W WindowManager:     at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop(WindowSurfacePlacer.java:178)
01-06 17:05:41.180   496  6715 W WindowManager:     at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:127)
01-06 17:05:41.180   496  6715 W WindowManager:     at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:116)
01-06 17:05:41.180   496  6715 W WindowManager:     at com.android.server.wm.WindowState.setupWindowForRemoveOnExit(WindowState.java:2344)
01-06 17:05:41.180   496  6715 W WindowManager:     at com.android.server.wm.WindowState.removeIfPossible(WindowState.java:2311)
01-06 17:05:41.180   496  6715 W WindowManager:     at com.android.server.wm.WindowState.access$300(WindowState.java:254)
01-06 17:05:41.180   496  6715 W WindowManager:     at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:2817)
01-06 17:05:41.180   496  6715 W WindowManager:     at android.os.IBinder$DeathRecipient.binderDied(IBinder.java:305)
01-06 17:05:41.180   496  6715 W WindowManager:     at android.os.BinderProxy.sendDeathNotice(BinderProxy.java:654)
01-06 17:05:41.181   496  1390 W ActivityTaskManager: Force removing ActivityRecord{d2e6031 u0 com.samplecompany.samplegame/com.dynamo.android.DefoldActivity t11}: app died, no saved state
01-06 17:05:41.182   303   370 D goldfish-address-space: claimShared: Ask to claim region [0x1f5b30000 0x1f610c000]
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_10 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_6 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_8 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_9 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_4 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_5 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_11 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_7 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_2 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_3 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_10 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_6 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_8 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_9 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_4 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_5 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_11 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_7 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_2 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.184   496  1390 W InputReader: Device virtio_input_multi_touch_3 is associated with display ADISPLAY_ID_NONE.
01-06 17:05:41.186   304   304 W EmuHWC2 : validate: layer 37 CompositionType 1, fallback
01-06 17:05:41.188   304   304 W EmuHWC2 : No layers, exit, buffer 0xb4000076c06c6460
01-06 17:05:41.197   496  4930 W ActivityManager: Unable to start service Intent { act=android.service.appprediction.AppPredictionService cmp=com.google.android.as/com.google.android.apps.miphone.aiai.app.AiAiPredictionService } U=0: not found
01-06 17:05:41.197   496  4930 W RemoteAppPredictionService: could not bind to Intent { act=android.service.appprediction.AppPredictionService cmp=com.google.android.as/com.google.android.apps.miphone.aiai.app.AiAiPredictionService } using flags 67108865
01-06 17:05:41.203  6722  6722 I A       : onApplyWindowInsets: systemWindowInsets=Insets{left=0, top=66, right=0, bottom=132}
01-06 17:05:41.237   496   520 W WindowManager: Failed to deliver inset state change to w=Window{bec9a77 u0 com.samplecompany.samplegame/com.dynamo.android.DefoldActivity EXITING}
01-06 17:05:41.237   496   520 W WindowManager: android.os.DeadObjectException
01-06 17:05:41.237   496   520 W WindowManager:     at android.os.BinderProxy.transactNative(Native Method)
01-06 17:05:41.237   496   520 W WindowManager:     at android.os.BinderProxy.transact(BinderProxy.java:540)
01-06 17:05:41.237   496   520 W WindowManager:     at android.view.IWindow$Stub$Proxy.insetsControlChanged(IWindow.java:765)
01-06 17:05:41.237   496   520 W WindowManager:     at com.android.server.wm.WindowState.notifyInsetsControlChanged(WindowState.java:3670)
01-06 17:05:41.237   496   520 W WindowManager:     at com.android.server.wm.InsetsStateController.lambda$notifyPendingInsetsControlChanged$4$InsetsStateController(InsetsStateController.java:445)
01-06 17:05:41.237   496   520 W WindowManager:     at com.android.server.wm.-$$Lambda$InsetsStateController$-1iOXDf-1s3wDHcMIHBKNk6MS3I.run(Unknown Source:2)
01-06 17:05:41.237   496   520 W WindowManager:     at com.android.server.wm.WindowAnimator.executeAfterPrepareSurfacesRunnables(WindowAnimator.java:341)
01-06 17:05:41.237   496   520 W WindowManager:     at com.android.server.wm.WindowAnimator.animate(WindowAnimator.java:222)
01-06 17:05:41.237   496   520 W WindowManager:     at com.android.server.wm.WindowAnimator.lambda$new$1$WindowAnimator(WindowAnimator.java:107)
01-06 17:05:41.237   496   520 W WindowManager:     at com.android.server.wm.-$$Lambda$WindowAnimator$ddXU8gK8rmDqri0OZVMNa3Y4GHk.doFrame(Unknown Source:2)
01-06 17:05:41.237   496   520 W WindowManager:     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:970)
01-06 17:05:41.237   496   520 W WindowManager:     at android.view.Choreographer.doCallbacks(Choreographer.java:796)
01-06 17:05:41.237   496   520 W WindowManager:     at android.view.Choreographer.doFrame(Choreographer.java:727)
01-06 17:05:41.237   496   520 W WindowManager:     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
01-06 17:05:41.237   496   520 W WindowManager:     at android.os.Handler.handleCallback(Handler.java:938)
01-06 17:05:41.237   496   520 W WindowManager:     at android.os.Handler.dispatchMessage(Handler.java:99)
01-06 17:05:41.237   496   520 W WindowManager:     at android.os.Looper.loop(Looper.java:223)
01-06 17:05:41.237   496   520 W WindowManager:     at android.os.HandlerThread.run(HandlerThread.java:67)
01-06 17:05:41.237   496   520 W WindowManager:     at com.android.server.ServiceThread.run(ServiceThread.java:44)
01-06 17:05:41.388   496   519 W ActivityManager: setHasOverlayUi called on unknown pid: 7198
01-06 17:05:41.203  6722  6722 I A       : onApplyWindowInsets: systemWindowInsets=Insets{left=0, top=66, right=0, bottom=132}
01-06 17:05:41.457   496  5001 D HostConnection: HostConnection::get() New Host Connection established 0xb400006e962d32d0, tid 5001
01-06 17:05:41.459   496  5001 D HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0 
01-06 17:05:41.459   496  5001 W OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
01-06 17:05:41.459   496  5001 D EGL_emulation: eglCreateContext: 0xb400006e863fd320: maj 3 min 0 rcv 3
01-06 17:05:41.460   496  5001 D EGL_emulation: eglMakeCurrent: 0xb400006e863fd320: ver 3 0 (tinfo 0xb400006e263d9410) (first time)
01-06 17:05:43.969   496  4930 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
01-06 17:05:45.110  1121  1121 D BoundBrokerSvc: onUnbind: Intent { act=com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START pkg=com.google.android.gms }

Can you provide a longer log?

Yes sure. I changed the names of the apps to “app1” and “app2”. App 1 was failing too but I just check now then it works. App 2 is still crashing at open.

It’s a long log (I don’t know what to cut off) so I put it in the text file, I hope you don’t mind.

Terminal Saved Output 2.txt (9.7 MB)

You can clear the entire log first by calling:

adb logcat -c

Then run as usual:

adb logcat

The documentation for logcat is found online:

Thanks. Here’s what I did:

  • Open file in text editor
  • Search for “DefoldActivity”
  • The first line mentioning “DefoldActivity” was this:
01-06 18:19:26.081   501  3101 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.companyname.app1 cmp=com.companyname.app1/com.dynamo.android.DefoldActivity} from uid 10122

This tells me that DefoldActivity is about to be launched. A few lines later I see:

01-06 18:19:26.126   501   530 I ActivityManager: Start proc 10702:com.companyname.app1/u0a168 for pre-top-activity {com.companyname.app1/com.dynamo.android.DefoldActivity}

This tells me the process id for your app: 10702

With the process id known I can easily follow the log until I find the last few log entries mentioning 10702:

01-06 18:20:28.501 10702 10702 V threaded_app: NativeWindowDestroyed: 0xb400006fd92f04f0 -- 0xb4000070992fa860
01-06 18:20:28.501 10702 10731 V threaded_app: APP_CMD_TERM_WINDOW
01-06 18:20:28.501 10702 10731 V glfw-android: handleCommand (looper thread): APP_CMD_TERM_WINDOW
01-06 18:20:28.501 10702 10731 V glfw-android: destroy_gl_surface
01-06 18:20:28.508 10702 10731 V glfw-android: iconified: YES    (resume: no, focus: no, surface: no)
01-06 18:20:28.508 10702 10731 V threaded_app: APP_CMD_TERM_WINDOW
01-06 18:20:28.508 10702 10702 V threaded_app: Stop: 0xb400006fd92f04f0
01-06 18:20:28.508 10702 10731 V threaded_app: activityState=14
01-06 18:20:28.508 10702 10731 V glfw-android: handleCommand (looper thread): APP_CMD_STOP
01-06 18:20:28.509 10702 10702 V threaded_app: SaveInstanceState: 0xb400006fd92f04f0
01-06 18:20:28.549 10702 10731 V glfw-android: handleCommand (looper thread): APP_CMD_SAVE_STATE
01-06 18:20:28.549 10702 10731 V threaded_app: APP_CMD_SAVE_STATE
01-06 18:20:28.568 10702 10734 V glfw-android: handleCommand (main thread): APP_CMD_TERM_WINDOW
01-06 18:20:28.568 10702 10734 V glfw-android: handleCommand (main thread): APP_CMD_STOP
01-06 18:20:28.568 10702 10734 V glfw-android: handleCommand (main thread): APP_CMD_SAVE_STATE

This tells us that something shut down the app “APP_CMD_TERM_WINDOW”, “destroy_gl_surface” etc. The error is somewhere above this. It’s about 600 lines of logs from the first to the last line so it’s doable to look through it in search of clues.

There is however nothing really obvious standing out in between the app starting until it shuts down. Can you please share some more info about your project. Are you using any extensions?

Relevant log entries attached:

Terminal Saved Output 2.txt (66.6 KB)

2 Likes

I do use monarch, orthographic, and defglot plugins.
There are nothing special about the apps, they are quite simple apps.

I re-bundle the apps with the latest version of Defold and upload the new .apk files to Play Store with no adjustment (beside changing the Android version code), and to my surprise they seems to be working again.

Thanks so much for the extensive help! (As always :grinning_face_with_smiling_eyes:)

1 Like

Huh, strange! Good that it works, but annoying that we don’t really know why!

1 Like