There are plenty of questions with ANR traces file included and the answer is always "oh, problem is in your thread 76, fix your http call" or something :) But I couldnt find any general guide or tutorial about how to read this traces, step-by-step for any ANR. Is there any? I have few questions in particular:
Is is always possible to see the problem from thread traces I see for real-world ANRs in google console? Or is it possible that there is just no relevant info and I am in bad luck if I cant reproduce the ANR locally?
What threads are included in this information? I suppose there are all threads from my app process, but what about the rest? Are they all in some way relevant for me? (for example threads that some of my threads are waiting for etc.) Or there are also completly unrelated processes?
How google play console determine the "place" where ANR happened - which is then displayed in list of ANRs, for example :
ANR keyDispatchingTimedOut
miesto: com.sample.myapp/myapp.activities.SplashActivity
Because SplashActivity is nowhere to be seen in supplied text of the threads traces.
- I know that I should look for threads in WAIT state for potencial deadlocks etc. How about the situation where the thread is "waiting on himself"?
"AsyncTask #1" prio=5 tid=15 WAIT | group="main" sCount=1 dsCount=0 obj=0x41bb50c0 self=0x5529a868 | sysTid=2448 nice=0 sched=0/0 cgrp=apps handle=1429609576 | state=S schedstat=( 18097077 39273309 41 ) utm=1 stm=0 core=1 at java.lang.Object.wait(Native Method) - waiting on <0x41bb5258> (a java.lang.VMThread) held by tid=15 (AsyncTask #1)
Is this always OK and I can assume this is not the cause? What about the situation, where I have only bunch of threads in NATIVE (including main thread) and bunch of threads in WAIT waiting on themselves like this? How can this be ANR?