Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Takes long time for crash dialog to appear #73

Closed
mwinters-stuff opened this issue Apr 11, 2013 · 10 comments
Closed

Takes long time for crash dialog to appear #73

mwinters-stuff opened this issue Apr 11, 2013 · 10 comments
Assignees
Milestone

Comments

@mwinters-stuff
Copy link

I have tried the 4.5 RC, but the crash dialog is not appearing for quite a long time - in one case it was about 4 hours later.

  1. Downloaded the 4.5 RC
  2. Replaced the previous version JAR
  3. Removed the theme for the dialog.
  4. Built and installed debug version of app on nexus 7
  5. make app crash.
  6. Dialog does not appear as it used to, now waiting from minutes to hours..
  7. Restore old jar
  8. Install app
  9. Make it crash
  10. Dialog appears instantly.

This is the code i use to initialize it, I have my own report sender (but we don't get there yet, that bit does work after the dialog)..

@ReportsCrashes(formKey = "", 
formUri="https://wintersacrareporter.appspot.com/acrareport",
  formUriBasicAuthLogin = "XX",   
  formUriBasicAuthPassword = "XX",
   mode = ReportingInteractionMode.DIALOG,
  resNotifTickerText = R.string.crash_notif_ticker_text,
  resNotifTitle = R.string.crash_notif_title,
  resNotifText = R.string.crash_notif_text,
  resNotifIcon = android.R.drawable.stat_notify_error,    // optional. default is a warning sign
  resDialogText = R.string.crash_dialog_text,
  resDialogIcon = android.R.drawable.ic_dialog_info, //opti onal. default is a warning sign
  resDialogTitle = R.string.crash_dialog_title, // optional. default is your application name
  resDialogCommentPrompt = R.string.crash_dialog_comment_prompt, // optional. when defined, adds a user text field input with this text resource as a label
  resDialogEmailPrompt = R.string.crash_dialog_email_prompt,
  resDialogOkToast = R.string.crash_dialog_ok_toast, // optional. displays a Toast message when the user accepts to send a report.
  sharedPreferencesName = "nz.org.winters.android.merchantwidget_preferences",
  customReportContent = {ReportField.ANDROID_VERSION,ReportField.APP_VERSION_CODE,ReportField.APP_VERSION_NAME, 
    //ReportField.APPLICATION_LOG, 
    ReportField.AVAILABLE_MEM_SIZE, 
    ReportField.BRAND, ReportField.BUILD, ReportField.CRASH_CONFIGURATION, ReportField.CUSTOM_DATA, 
    ReportField.DEVICE_FEATURES, ReportField.DEVICE_ID, ReportField.DISPLAY, ReportField.DROPBOX, 
    ReportField.DUMPSYS_MEMINFO, ReportField.ENVIRONMENT, ReportField.EVENTSLOG, ReportField.FILE_PATH, 
    ReportField.INITIAL_CONFIGURATION, ReportField.INSTALLATION_ID, ReportField.IS_SILENT, ReportField.LOGCAT, 
    //ReportField.MEDIA_CODEC_LIST, 
    ReportField.PACKAGE_NAME, ReportField.PHONE_MODEL,
    ReportField.PRODUCT, ReportField.RADIOLOG, ReportField.REPORT_ID, 
    //ReportField.SETTINGS_GLOBAL, 
    ReportField.SETTINGS_SECURE,
    ReportField.SETTINGS_SYSTEM, ReportField.SHARED_PREFERENCES, ReportField.STACK_TRACE, ReportField.THREAD_DETAILS,
    ReportField.TOTAL_MEM_SIZE, ReportField.USER_APP_START_DATE, ReportField.USER_COMMENT, ReportField.USER_CRASH_DATE,
    ReportField.USER_EMAIL, 
    //ReportField.USER_IP  
  }
)
public class CrashAppWrapper extends Application
{
  @Override
  public void onCreate() {
      // The following line triggers the initialization of ACRA
    super.onCreate();
    try
    {
      ACRA.init(this);
      ACRA.getErrorReporter().setReportSender(new ACRAReporterSender(this));
    }catch(IllegalStateException e)
    {
      // ignore acra error
    }


  }

}
@KevinGaudin
Copy link
Member

It might be caused by the usage of Actvity lifecycle callbacks to remove the latest activity from the stack on recent Android versions because users were experiencing crash loops.

In the case of the DIALOG interaction method, we add a new activity to the stack just before killing the app...

@KevinGaudin
Copy link
Member

@wintersandroid would you copy here the declaration of the CrashReportDialog from your AndroidManifest.xml ?

@mwinters-stuff
Copy link
Author

This is what I have..

@KevinGaudin
Copy link
Member

Thanks. And could you copy the logcat extract from the moment ACRA catches the exception to when the app is restarted ?

@mwinters-stuff
Copy link
Author

04-18 10:19:49.779: W/dalvikvm(1560): threadid=1: thread exiting with uncaught exception (group=0xb5025180)
04-18 10:19:49.779: E/ACRA(1560): ACRA caught a NullPointerException exception for nz.org.winters.android.merchantwidget. Building report.
04-18 10:19:49.829: D/dalvikvm(1560): GC_CONCURRENT freed 476K, 6% free 9843K/10439K, paused 0ms+1ms
04-18 10:19:49.859: D/dalvikvm(894): GC_CONCURRENT freed 438K, 17% free 11468K/13767K, paused 1ms+2ms
04-18 10:19:49.909: D/dalvikvm(1560): GC_CONCURRENT freed 433K, 7% free 9794K/10439K, paused 1ms+0ms
04-18 10:19:49.909: I/ACRA(1560): READ_LOGS not allowed. ACRA will not include LogCat and DropBox data.
04-18 10:19:49.909: D/ACRA(1560): Writing crash report file 1366237189000.stacktrace.
04-18 10:19:49.919: D/ACRA(1560): Waiting for Toast + worker...
04-18 10:19:49.919: D/ACRA(1560): About to create DIALOG from #handleException
04-18 10:19:49.919: D/ACRA(1560): Creating Dialog for 1366237189000.stacktrace
04-18 10:19:49.919: I/ActivityManager(894): START {flg=0x10000000 cmp=nz.org.winters.android.merchantwidget/org.acra.CrashReportDialog (has extras)} from pid 1560
04-18 10:19:49.959: D/ACRA(1560): Wait for Toast + worker ended. Kill Application ? true
04-18 10:19:49.959: E/ACRA(1560): nz.org.winters.android.merchantwidget fatal error : null
04-18 10:19:49.959: E/ACRA(1560): java.lang.NullPointerException
04-18 10:19:49.959: E/ACRA(1560):   at nz.org.winters.android.widgetscommon.activities.LauncherActivity.onClick(LauncherActivity.java:227)
04-18 10:19:49.959: E/ACRA(1560):   at android.view.View.performClick(View.java:3511)
04-18 10:19:49.959: E/ACRA(1560):   at android.view.View$PerformClick.run(View.java:14105)
04-18 10:19:49.959: E/ACRA(1560):   at android.os.Handler.handleCallback(Handler.java:605)
04-18 10:19:49.959: E/ACRA(1560):   at android.os.Handler.dispatchMessage(Handler.java:92)
04-18 10:19:49.959: E/ACRA(1560):   at android.os.Looper.loop(Looper.java:137)
04-18 10:19:49.959: E/ACRA(1560):   at android.app.ActivityThread.main(ActivityThread.java:4424)
04-18 10:19:49.959: E/ACRA(1560):   at java.lang.reflect.Method.invokeNative(Native Method)
04-18 10:19:49.959: E/ACRA(1560):   at java.lang.reflect.Method.invoke(Method.java:511)
04-18 10:19:49.959: E/ACRA(1560):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-18 10:19:49.959: E/ACRA(1560):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-18 10:19:49.959: E/ACRA(1560):   at dalvik.system.NativeStart.main(Native Method)
04-18 10:19:49.959: I/ACRA(1560): Finishing the last Activity prior to killing the Process
04-18 10:19:49.959: I/ACRA(1560): Finished class nz.org.winters.android.widgetscommon.activities.LauncherActivity
04-18 10:19:49.959: I/Process(1560): Sending signal. PID: 1560 SIG: 9
04-18 10:19:49.959: I/ActivityManager(894): Process nz.org.winters.android.merchantwidget (pid 1560) has died.
04-18 10:19:49.959: I/WindowManager(894): WIN DEATH: Window{b5c31da0 nz.org.winters.android.merchantwidget/nz.org.winters.android.widgetscommon.activities.LauncherActivity paused=true}
04-18 10:19:49.969: W/NetworkManagementSocketTagger(894): setKernelCountSet(10042, 0) failed with errno -2
04-18 10:19:49.969: D/dalvikvm(1601): Not late-enabling CheckJNI (already on)
04-18 10:19:49.969: I/ActivityManager(894): Start proc nz.org.winters.android.merchantwidget for activity nz.org.winters.android.merchantwidget/org.acra.CrashReportDialog: pid=1601 uid=10042 gids={3003}
04-18 10:19:49.989: W/NetworkManagementSocketTagger(894): setKernelCountSet(10042, 1) failed with errno -2
04-18 10:19:49.989: I/ActivityThread(1601): Pub nz.org.winters.android.merchantwidget.listwidget.provider: nz.org.winters.android.merchantwidget.listwidget.ListWidgetDataProvider
04-18 10:19:49.999: D/ACRA(1601): ACRA is enabled for nz.org.winters.android.merchantwidget, intializing...
04-18 10:19:49.999: D/ACRA(1601): Using custom Report Fields
04-18 10:19:50.021: D/dalvikvm(1601): GC_CONCURRENT freed 221K, 3% free 9198K/9479K, paused 0ms+0ms
04-18 10:19:50.029: D/ACRA(1601): Looking for error files in /data/data/nz.org.winters.android.merchantwidget/files
04-18 10:19:50.029: D/ACRA(1601): Looking for error files in /data/data/nz.org.winters.android.merchantwidget/files
04-18 10:19:50.029: D/ACRA(1601): Looking for error files in /data/data/nz.org.winters.android.merchantwidget/files
04-18 10:19:50.029: D/ACRA(1601): Creating Dialog for 1366237189000.stacktrace
04-18 10:19:50.029: I/ActivityManager(894): START {flg=0x10000000 cmp=nz.org.winters.android.merchantwidget/org.acra.CrashReportDialog (has extras)} from pid 1601
04-18 10:19:50.029: W/Ads(1601): No Google Analytics: Library Incompatible.
04-18 10:19:50.029: D/ACRA(1601): Opening CrashReportDialog for 1366237189000.stacktrace
04-18 10:19:50.059: D/dalvikvm(894): GC_EXPLICIT freed 267K, 17% free 11444K/13767K, paused 0ms+0ms
04-18 10:19:50.070: D/libEGL(1601): loaded /system/lib/egl/libGLES_android.so
04-18 10:19:50.070: D/libEGL(1601): loaded /system/lib/egl/libEGL_emulation.so
04-18 10:19:50.079: D/(1601): HostConnection::get() New Host Connection established 0x8de3570, tid 1601
04-18 10:19:50.079: D/libEGL(1601): loaded /system/lib/egl/libGLESv1_CM_emulation.so
04-18 10:19:50.079: D/libEGL(1601): loaded /system/lib/egl/libGLESv2_emulation.so
04-18 10:19:50.139: W/EGL_emulation(1601): eglSurfaceAttrib not implemented
04-18 10:19:50.189: D/OpenGLRenderer(1601): Enabling debug mode 0
04-18 10:19:50.214: D/(785): HostConnection::get() New Host Connection established 0x8c2a960, tid 878
04-18 10:19:50.259: W/EGL_emulation(1601): eglSurfaceAttrib not implemented
04-18 10:19:50.480: I/Process(894): Sending signal. PID: 1601 SIG: 3
04-18 10:19:50.480: I/dalvikvm(1601): threadid=3: reacting to signal 3
04-18 10:19:50.480: I/dalvikvm(1601): Wrote stack traces to '/data/anr/traces.txt'
04-18 10:19:50.541: W/InputManagerService(894): Got RemoteException sending setActive(false) notification to pid 1560 uid 10042
04-18 10:19:50.559: W/NetworkManagementSocketTagger(894): setKernelCountSet(10012, 1) failed with errno -2
04-18 10:19:50.589: W/EGL_emulation(1023): eglSurfaceAttrib not implemented
04-18 10:19:50.629: D/dalvikvm(1023): GC_FOR_ALLOC freed 3325K, 23% free 12272K/15879K, paused 4ms
04-18 10:19:50.729: D/dalvikvm(1023): GC_CONCURRENT freed 43K, 17% free 13241K/15879K, paused 0ms+1ms
04-18 10:19:50.789: I/ActivityManager(894): Displayed nz.org.winters.android.merchantwidget/org.acra.CrashReportDialog: +827ms
04-18 10:19:50.809: D/dalvikvm(1023): GC_FOR_ALLOC freed 1701K, 19% free 12886K/15879K, paused 3ms
04-18 10:19:50.819: D/dalvikvm(1023): GC_FOR_ALLOC freed 309K, 19% free 13004K/15879K, paused 3ms
04-18 10:19:50.819: I/dalvikvm-heap(1023): Grow heap (frag case) to 13.985MB for 1286220-byte allocation
04-18 10:19:50.849: D/dalvikvm(1023): GC_FOR_ALLOC freed 0K, 17% free 14260K/17159K, paused 4ms
04-18 10:19:50.859: D/dalvikvm(1023): GC_CONCURRENT freed 1549K, 24% free 13196K/17159K, paused 1ms+1ms
04-18 10:19:50.960: D/OpenGLRenderer(1601): Flushing caches (mode 0)
04-18 10:19:51.021: W/NetworkManagementSocketTagger(894): setKernelCountSet(10042, 0) failed with errno -2
04-18 10:19:51.039: D/OpenGLRenderer(1601): Flushing caches (mode 1)
04-18 10:19:55.040: I/GAV2(1601): Thread[GAThread,5,main]: connecting to Analytics service
04-18 10:19:55.040: W/ActivityManager(894): Unable to start service Intent { act=com.google.android.gms.analytics.service.START (has extras) }: not found
04-18 10:19:55.040: I/GAV2(1601): Thread[GAThread,5,main]: connect: bindService returned false for Intent { act=com.google.android.gms.analytics.service.START (has extras) }
04-18 10:19:55.040: W/GAV2(1601): Thread[GAThread,5,main]: Service unavailable (code=1), will retry.
04-18 10:19:55.040: I/GAV2(1601): Thread[GAThread,5,main]: No campaign data found.

Now..

My app crashed at startup - something failed in the widget and the dialog appeared, the above report is not for that. I cancelled the dialog..

Then I launched the activity with the test null pointer exception, and it appears like the activity is trying to show then it goes away immediately..

My app implements a widget, which has services e.t.c. running in the background..

@mwinters-stuff
Copy link
Author

I downloaded the source and added in some debug statements..

To fix this problem, remove the mDialog.dismiss() from CrashReportDialog.onPause()

I have been using android 4.2.2, it seems (and makes sense) that the activity gets an onPause() when the dialog is shown above...

@kaushikprajapati
Copy link

Does it show any other problem. if you put that fix?

@KevinGaudin
Copy link
Member

Ok @wintersandroid, I'll test this tonight. The strange thing is that I can't reproduce the issue with my emulator. But it does make sense ;-)

@KevinGaudin
Copy link
Member

Well I was testing on 4.1 and now with a 4.2.2 emulator I could reproduce the issue and the fix works like a charm.
Thank you @wintersandroid !

@kaushikprajapati
Copy link

@KevinGaudin It fixes #78 as well.
@wintersandroid Thanks for the solution. It works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants