0

I have implemented Firebase Authentication, Realtime Database and Analytics in my app. If the app is started and remains idle on certain phones, it throws an ANR message.

Logcat shows:

E/ActivityManager: ANR in com.demo.droid
PID: 16376
Reason: executing service com.demo.droid/com.google.android.gms.tagmanager.TagManagerService
Load: 8.5 / 8.88 / 8.98
CPU usage from 3255ms to -2309ms ago:

Is there any way to catch this error before it is thrown on screen?

Nikhil Tambe
  • 502
  • 1
  • 4
  • 13
  • To avoid ANR, place time-consuming operations in a separate thread. – Fustigador Jun 15 '16 at 12:25
  • Maybe [related to this](http://stackoverflow.com/questions/37357974/after-upgrading-to-google-play-services-9-0-0-app-hangs-in-dynamitemodulesc)? – Bob Snyder Jun 15 '16 at 13:45
  • Do you have more details on which phones this happens on, and stack traces for this issue? Have you compiled your app in Android Studio, or via another mechanism (Eclipse, etc)? Is the TagManagerService in the merged AndroidManifest.xml? – Eric Burley Jun 15 '16 at 16:56
  • @EricBurley : phone: Nexus 5, running android M. using Android Studio. The actual problem is that, i haven't even created or implemented the TagManagerService anywhere directly in my app. The app just throws an ANR and logcat shows the message. – Nikhil Tambe Jun 18 '16 at 09:59

1 Answers1

0

ANR cannot be catched. It means that some of your function in UI thread cost too much time

JN.Meng
  • 1
  • 2