Does anyone know why this happens? I see this crash reported by my app but I have no idea what it is.
java.lang.NoClassDefFoundError: android.app.ANRManagerP
This error can be seen on a small group of devices (I don't have a list, but they tend to be no-name brands) whose firmware developers, for unknown reasons, removed the ANRManagerProxy
from the device framework (I confirmed this by hunting down a firmware and decompiling it myself).
The best you can do is try to hunt down any possible code which could be locking up the thread and causing the device to become nonresponsive, and try to use an AsyncTask
or similar to run the code asynchronously and avoid the ANR. The devices in question are always low end, and so your code will take longer to run and have a greater chance of causing this to happen.
I'd suggest Hugo as a great library for debugging method execution times, in order to narrow your focus on where the most time is being spent. This will help improve your code for all users, as well as reducing the risk of the crash in question.