How do I interpret ANR traces.txt when my code doesn't appear on stack? How do I interpret ANR traces.txt when my code doesn't appear on stack? android android

How do I interpret ANR traces.txt when my code doesn't appear on stack?


Basic investigate steps

  1. Find "waiting to lock"

    • you can find monitor state "Binder Thread #15" prio=5 tid=75 MONITOR

    • you are lucky if find "waiting to lock"

    • example : waiting to lock <0xblahblah> (a com.foo.A) held by threadid=74

  2. You can notice that "tid=74" hold a task now. So go to tid=74

  3. tid=74 maybe SUSPENDED state! find main reason!trace does not always contain "waiting to lock". in this case it is hard to find main reason.

source: https://stackoverflow.com/a/24761645/2715054