0

I know this question is probably asked few times but I can not find a valid answer for my case. In my logcat I get

D/AndroidRuntime﹕ Shutting down VM
W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x418337c0)

which indicates I have a crash somewhere, but I can not see it in log, there is no more information about the crash. I have tried

  1. adb server -kill, adb server-start.
  2. I closed the adb from the proccess in Task Manager and closed AndroidStudio and started everything again (I tried restart windows too). I am using CrashLytics in my application, but I do not receive crash there either, however TestFairy was able to give me finally some information which is application ANR and the next log (sorry about messy log)

java.lang.Object.wait(Native Method)

java.lang.Thread.parkFor(Thread.java:1231)
    sun.misc.Unsafe.park(Unsafe.java:323)
    java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
    java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:813)
    java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:846)
    java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1176)
    java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:185)
    java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:261)
    com.google.android.gms.analytics.zzx.zzfj(Unknown Source)
    com.google.android.gms.analytics.GoogleAnalytics.zzfj(Unknown Source)
    com.google.android.gms.analytics.ExceptionReporter.uncaughtException(Unknown Source)
    java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
    java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
    dalvik.system.NativeStart.main(Native Method)

so I tried to search around and some says it can be a crash in GoogleAnalytics while trying to report another crash. so I disabled this code

UncaughtExceptionHandler myHandler = new ExceptionReporter(
                mTracker,Thread.getDefaultUncaughtExceptionHandler(),
                getContext().getApplicationContext());
        Thread.setDefaultUncaughtExceptionHandler(myHandler);

I know that this issue happens after trying to open a fragment but when I debug the fragment is not started yet. The problem is I still can not see any more information, so How can I see log or more information? Thanks and sorry for long post.

M.Baraka
  • 725
  • 1
  • 10
  • 24
  • 1
    If your facing an ANR then get the trace files. http://stackoverflow.com/questions/704311/android-how-do-i-investigate-an-anr . If your not able to analyze that post your traces file. – manjusg Jul 28 '15 at 08:43
  • Thanks that helped, sorry took time to answer I had to find how to get the trace file. I have question though, why suddenly It started to show the crash log? @manjusg – M.Baraka Jul 28 '15 at 09:51

1 Answers1

0

An ANR will occur if you are running a process on the UI thread which takes a long time, usually around 5 seconds. During this time the GUI (Graphical User Interface) will lock up which will result in anything the user presses will not be actioned. After the 5 seconds approx has occurred, if the thread still hasn't recovered then an ANR dialogue box is shown informing the user that the application is not responding and will give the user the choice to either wait, in the hope that the app will eventually recover, or to force close the app.