jinwook1469 / acra

Automatically exported from code.google.com/p/acra
0 stars 0 forks source link

Using ReportingInteractionMode.NOTIFICATION causes app crash 4.1.0b #54

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Using ReportingInteractionMode.NOTIFICATION causes app crash.  Setting to 
ReportingInteractionMode.SILENT makes the problem go away.  Was broken in 
earlier builds, reproduced on 4.1.0b.  This is via handleSilentException(), I 
don't know what happens with a natural unhandled exception.

Stack trace:

java.lang.NullPointerException
  at org.acra.ErrorReporter.getCrashReportFilesList(ErrorReporter.java:888)
  at org.acra.ErrorReporter.approvePendingReports(ErrorReporter.java:252)
  at org.acra.ErrorReporter.handleException(ErrorReporter.java:741)
  at org.acra.ErrorReporter.handleSilentException(ErrorReporter.java:775)
etc.

Thanks!

Original issue reported on code.google.com by sstrea...@gmail.com on 26 May 2011 at 5:14

GoogleCodeExporter commented 8 years ago
I will check this tonight. Thanks for reporting.

Original comment by kevin.gaudin on 26 May 2011 at 6:40

GoogleCodeExporter commented 8 years ago
Hi Scott,

Where in your code is your handleSilentException() call located ?
The only thing that can trigger a NPE at ErrorReporter.java:888 is the 
application context which should be initialized during the call to 
ACRA.init(yourApplication) in your application.onCreate() method.

I ran my own test app (one button for a real exception, one button for a silent 
exception) right now and it did not crash. Just got a timeout from GDocs while 
submitting the form... and the second call got 2 reports sent without any issue.

Original comment by kevin.gaudin on 27 May 2011 at 11:38

GoogleCodeExporter commented 8 years ago
Hey Kevin, I'm calling it from a PreferenceActivity implementation where the 
users clicks to manually send the report.  ACRA.init(this) is the first line in 
the onCreate() override of my Application instance.  Again, this is OK in 
SILENT mode... NOTIFICATION mode behaves differently for whatever reason.

Let me know if I can provide add'l info.

Original comment by sstrea...@gmail.com on 27 May 2011 at 11:58

GoogleCodeExporter commented 8 years ago
Scott,
Some logcat content would be great from the application start down to the 
NullPointerException. You can send it to me via email.
Kevin

Original comment by kevin.gaudin on 29 May 2011 at 9:34

GoogleCodeExporter commented 8 years ago
I finally reproduced similar errors after playing with both acra.disable 
SharedPreferences and a silent report in one PreferenceActivity item.
I fixed 2 things:
  * do not send silent reports if acra.enabled or acra.disabled SharedProperties have been set to disable ACRA.
  * after application restart with ACRA disabled from SharedPreferences settings, ACRA was not able to detect a change on this setting and reactivate. 

Here is a new version of ACRA in the maven repo. You'll have to create a new 
spreadsheet as I added a new field SHARED_PREFERENCES.

http://acra.googlecode.com/svn/repository/releases/org/acra/acra/4.2.0b/acra-4.2
.0b.zip

Original comment by kevin.gaudin on 29 May 2011 at 11:24

GoogleCodeExporter commented 8 years ago

Original comment by kevin.gaudin on 29 May 2011 at 11:24

GoogleCodeExporter commented 8 years ago
Hi Kevin,

So, no NPE anymore but I've changed the mode to NOTIFICATION and am only 
getting silent feedback.  Admittedly I've not used NOTIFICATION mode in 
previous versions of ACRA so it's possible I've done something wrong.  I 
specified resNotifTickerText, resNotifTitle, resNotifText, and resDialogText 
thinking they might be required/necessary but no change in behavior -- I'm only 
getting a silent report.

Your thoughts?  Can I provide you with more information?

Original comment by sstrea...@gmail.com on 30 May 2011 at 12:14

GoogleCodeExporter commented 8 years ago
The original issue has been fixed in ACRA 4.2. If you still have problems with 
ACRA 4.2.3 and NOTIFICATION mode, please open a new issue.

Original comment by kevin.gaudin on 25 Nov 2011 at 11:39