ANR (Application Not Responding) Slow Exit

2 weeks ago 18
ARTICLE AD BOX

Google Play is reporting ANRs mainly for Samsung devices with Android 16. I tested with various devices including Samsung but couldn't reproduce the ANR. I profiled the app and checked system trace but no clue. Any idea on how to detect the root cause and also reproduce the issue?

From Google Play console:

The main thread has finished processing events and is shutting down the app. As part of this process, it waits for all other threads to finish.

Recommendation

If there is a thread that does not finish, it is possible that the app will show an ANR as the system considers it to still be active. A common cause for this type of ANR is installing a new uncaught exception handler that does not delegate to the previous handler. Failure to call back into the previous handler will cause an ANR."

#00 pc 0x000000000009361c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) #01 pc 0x0000000000201230 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks+136) #02 pc 0x00000000008b851c /apex/com.android.art/lib64/libart.so (art::ThreadList::WaitForOtherNonDaemonThreadsToExit+204) #03 pc 0x00000000007ef1c4 /apex/com.android.art/lib64/libart.so (art::JII::DestroyJavaVM+36) #04 pc 0x000000000012e5c0 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start+1084) #05 pc 0x00000000000025b8 /system/bin/app_process64 (main+1284) #06 pc 0x0000000000068180 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+120)
Read Entire Article