vedhavyas / acra

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

ACRA crashes when trying to submit crash via notification #60

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have ACRA set up like this:

ReportsCrashes(
        formKey = "", // Unused
        mailTo = "dbschuler@gmail.com",
        mode = ReportingInteractionMode.NOTIFICATION,
        resNotifTickerText = R.string.crash_notif_ticker_text,
        resNotifTitle = R.string.crash_notif_title,
        resNotifText = R.string.crash_notif_text,
        resDialogText = R.string.crash_dialog_text,
        customReportContent = {
                ReportField.APP_VERSION_CODE,
                ReportField.ANDROID_VERSION,
                ReportField.PHONE_MODEL,
                ReportField.CUSTOM_DATA,
                ReportField.STACK_TRACE,
                ReportField.LOGCAT,
                ReportField.USER_COMMENT})
public class ACRAService extends Application {....}

=================================

When I induce a crash, the notification appears correctly, but when I select OK 
to submit the bug report, ACRA crashes:

E/ACRA    (13205): ACRA caught a NullPointerException exception for 
com.schulermobile.puddledrops. Building report.
D/ACRA    (13205): Retrieve application default SharedPreferences.
I/ACRA    (13205): READ_LOGS granted! ACRA can include LogCat and DropBox data.
D/ACRA    (13205): Retrieving logcat output...
D/ACRA    (13205): Writing crash report file.
D/ACRA    (13205): Retrieve application default SharedPreferences.
D/ACRA    (13205): Creating Notification for 1309904818000.stacktrace
E/ACRA    (13205): Puddle Drops fatal error : null
E/ACRA    (13205): java.lang.NullPointerException
E/ACRA    (13205):      at 
org.acra.ErrorReporter$ReportsSenderWorker.run(ErrorReporter.java:139)
I/Process (13205): Sending signal. PID: 13205 SIG: 9

==================================

This is reproducible every time. However, using a toast instead works as 
expected.
For what it's worth, I'm seeing this on a Nexus One running 2.3.4.

Original issue reported on code.google.com by dbschu...@gmail.com on 5 Jul 2011 at 10:33

GoogleCodeExporter commented 8 years ago
Hi,

What version of ACRA are you using ? I just tried with the stable 4.2.3 and did 
not reproduce the issue.

The mailTo feature was broken in some beta releases and fixed since 4.2.1b.

Kevin

Original comment by kevin.gaudin on 5 Jul 2011 at 10:45

GoogleCodeExporter commented 8 years ago
Hi Kevin,

I'm running into this with 4.2.3 stable.
The email feature works as expected with the toast reporting mode.
With the notification mode, I run into the null pointer exception above before 
an email is sent (the notification pops up, and I can select OK, but that's it).

    Daniel

Original comment by dbschu...@gmail.com on 6 Jul 2011 at 2:36

GoogleCodeExporter commented 8 years ago
After using ACRA from source, I was able to get the notification mode to work.

In ErrorReport.java:118-134:

        public void run() {
            final PowerManager.WakeLock wakeLock = acquireWakeLock();
            try {
                if (mApprovePendingReports) {
                    approvePendingReports();
                    if (mCommentedReportFileName == null)              // I added this test as a hack - this variable is null every time for me
                        mCommentedReportFileName = new String();    // Notification mode works as long as we don't call replace on a null object below
                    mCommentedReportFileName = mCommentedReportFileName.replace(REPORTFILE_EXTENSION, APPROVED_SUFFIX + REPORTFILE_EXTENSION);
                }
                addUserDataToReport(mContext, mCommentedReportFileName, mUserComment, mUserEmail);
                checkAndSendReports(mContext, mSendOnlySilentReports);
            } finally {
                if (wakeLock != null) {
                    wakeLock.release();
                }
            }
        }

I'm sure this isn't the right way to fix the issue, but hopefully it's enough 
to point you in the right direction.
Thanks,

    Daniel

Original comment by dbschu...@gmail.com on 6 Jul 2011 at 4:58

GoogleCodeExporter commented 8 years ago
For what it's worth, the notification mode also works with Google spreadsheet 
error reporting. Only the combination of email and notification mode throw an 
exception here.

    Daniel

Original comment by dbschu...@gmail.com on 6 Jul 2011 at 5:49

GoogleCodeExporter commented 8 years ago
I get this same crash having just updated to v4. About to go spelunking in the 
source code to see why...

Original comment by reuben.s...@gmail.com on 21 Jul 2011 at 1:19

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
same problem here using 4.23 stable

------------------
@ReportsCrashes(formKey = "", // will not be used
        mailTo = "your@example.com",

        resNotifIcon=R.drawable.icon,
        resNotifTickerText=R.string.resDialogText,
        resNotifText=R.string.resNotifText,
        resNotifTitle=R.string.resNotifTitle,
        resDialogText=R.string.resDialogText,
        mode = ReportingInteractionMode.NOTIFICATION
        )
--------------------
Application:
    @Override
    public void onCreate() {
        ACRA.init(this);
        super.onCreate();

    }

-----------------------

<activity  android:name = "org.acra.CrashReportDialog"   
                    android:theme = "@android:style/Theme.Dialog"   
                    android:launchMode = "singleInstance"   
                    android:excludeFromRecents = "true"   
                    android:finishOnTaskLaunch = "true"    /> 

-----------------
<uses-permission android:name="android.permission.READ_LOGS"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>

Original comment by jamiro...@gmail.com on 30 Aug 2011 at 7:57

GoogleCodeExporter commented 8 years ago
adding resDialogCommentPrompt to @ReportsCrashes seems to solve

Original comment by jamiro...@gmail.com on 30 Aug 2011 at 8:26

GoogleCodeExporter commented 8 years ago
I just got a similar exception (received from ACRA):
Somebody knows what's going on?

java.lang.RuntimeException: Package manager has died
    at android.app.ContextImpl$ApplicationPackageManager.checkPermission(ContextImpl.java:2045)
    at org.acra.ErrorReporter$ReportsSenderWorker.acquireWakeLock(ErrorReporter.java:155)
    at org.acra.ErrorReporter$ReportsSenderWorker.run(ErrorReporter.java:135)
Caused by: android.os.DeadObjectException
    at android.os.BinderProxy.transact(Native Method)
    at android.content.pm.IPackageManager$Stub$Proxy.checkPermission(IPackageManager.java:1392)
    at android.app.ContextImpl$ApplicationPackageManager.checkPermission(ContextImpl.java:2043)
    ... 2 more
android.os.DeadObjectException
    at android.os.BinderProxy.transact(Native Method)
    at android.content.pm.IPackageManager$Stub$Proxy.checkPermission(IPackageManager.java:1392)
    at android.app.ContextImpl$ApplicationPackageManager.checkPermission(ContextImpl.java:2043)
    at org.acra.ErrorReporter$ReportsSenderWorker.acquireWakeLock(ErrorReporter.java:155)
    at org.acra.ErrorReporter$ReportsSenderWorker.run(ErrorReporter.java:135)

Original comment by jin...@gmail.com on 4 Oct 2011 at 7:58

GoogleCodeExporter commented 8 years ago
after removing resDialogCommentPrompt from @ReportsCrashes this exact same 
error occurred.

12-07 12:35:02.330 E/ACRA    ( 9901): java.lang.NullPointerException
12-07 12:35:02.330 E/ACRA    ( 9901):   at 
org.acra.ErrorReporter$ReportsSenderWorker.run(ErrorReporter.java:139)

adding resDialogCommentPrompt back to @ReportsCrashes solves the problem 
indeed, as noted in comment 8.

Original comment by stefan.simroth on 7 Dec 2011 at 12:52

GoogleCodeExporter commented 8 years ago
Contrary to comment 4, I also have this issue with Google spreadsheet error 
reporting. But I can also confirm adding resDialogCommentPrompt resolves it.

Original comment by stefan.k...@gmail.com on 28 Dec 2011 at 3:38

GoogleCodeExporter commented 8 years ago
Same problem.
resDialogCommentPrompt MUST be defined with mode = NOTIFICATION

Currently I'm not able to create notification without asking for user comment.

Original comment by mice777 on 11 Jan 2012 at 9:05

GoogleCodeExporter commented 8 years ago
Just fixed this in the (not stable yet) trunk.

Thanks for your reports.

Kevin

Original comment by kevin.gaudin on 13 Jan 2012 at 11:02

GoogleCodeExporter commented 8 years ago

Original comment by kevin.gaudin on 13 Jan 2012 at 11:03

GoogleCodeExporter commented 8 years ago
I've been using ACRA for several months now and have just run into this issue. 
I have two versions of my product which use the same ACRA configuration, one 
fails one does not.

To cut a long story short I removed the app from my phone and I cleared down 
the eclipse gen directory and rebuilt and the problem went away?

Original comment by mydisc...@discoid.eu on 4 Feb 2012 at 10:34

GoogleCodeExporter commented 8 years ago
Same thing happens, it looks when trying to post to my webserver.  My phone has 
full internet connection and everything else was working that was connected to 
the internet.

07-12 14:04:22.774: E/ACRA(13629): Failed to send crash report for 
1342116157000-approved.stacktrace
07-12 14:04:22.774: E/ACRA(13629): org.acra.sender.ReportSenderException: Error 
while sending report to Http Post Form.
07-12 14:04:22.774: E/ACRA(13629):  at 
org.acra.sender.HttpPostSender.send(HttpPostSender.java:106)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.acra.ErrorReporter.sendCrashReport(ErrorReporter.java:850)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.acra.ErrorReporter.checkAndSendReports(ErrorReporter.java:960)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.acra.ErrorReporter$ReportsSenderWorker.run(ErrorReporter.java:142)
07-12 14:04:22.774: E/ACRA(13629): Caused by: java.net.SocketTimeoutException
07-12 14:04:22.774: E/ACRA(13629):  at 
java.net.PlainSocketImpl.read(PlainSocketImpl.java:491)
07-12 14:04:22.774: E/ACRA(13629):  at 
java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
07-12 14:04:22.774: E/ACRA(13629):  at 
java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInp
utBuffer.java:103)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInput
Buffer.java:191)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.
java:82)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:1
74)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(Abstract
HttpClientConnection.java:180)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultC
lientConnection.java:235)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(Abstra
ctClientConnAdapter.java:259)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecut
or.java:279)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:12
1)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirecto
r.java:428)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:5
55)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:4
87)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.acra.util.HttpRequest.sendPost(HttpRequest.java:109)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.acra.util.HttpRequest.sendPost(HttpRequest.java:80)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.acra.util.HttpUtils.doPost(HttpUtils.java:59)
07-12 14:04:22.774: E/ACRA(13629):  at 
org.acra.sender.HttpPostSender.send(HttpPostSender.java:103)

Original comment by waseem.s...@gmail.com on 12 Jul 2012 at 6:06

GoogleCodeExporter commented 8 years ago

Original comment by kevin.gaudin on 7 Sep 2012 at 9:31