Giter VIP home page Giter VIP logo

acra's Introduction

Current Status
Build test
Maven Central Maven Central
Android Versions minVersion targetVersion
License license
Statistics AppBrain stats

What is ACRA ?

ACRA is an open-source library for Android developers to easily integrate crash reporting into their applications. It provides a comprehensive set of features, including customizable reporting, support for multiple different senders, and flexible data collection options, enabling developers to quickly identify and diagnose issues in their apps.

ACRA is used in 1.57% (See AppBrain/stats) of all apps on Google Play as of June 2020. That's over 13 thousand apps and over 5 billion downloads including ACRA.

A crash reporting feature for android apps is native since Android 2.2 (FroYo) but only available through the official Android Market (and with limited data). ACRA is a great help for Android developers:

ACRA's notification systems are clean. If a crash occurs, your application does not add user notifications over existing system's crash notifications or reporting features. By default, the "force close" dialog is not displayed anymore, to enable it set alsoReportToAndroidFramework to true.

The user is notified of an error only once, and you might enhance the perceived quality of your application by defining your own texts in the notifications/dialogs.

Please do not hesitate to open defects/enhancements requests in the issue tracker.

How to use

Our Website covers a step-by-step guide for initial setup as well as advanced usage information.

Latest version

For the latest version and a complete changelog, please see the Release page.

For migrating from 4.x, please see our Migration guide in the Wiki.

Backends

Acrarium is the official backend for report storage and analysis. Acrarium is still in active development.

Acralyzer was the official backend before that. It runs on CouchDB, for which free hosting solutions exist. It is feature complete, but currently unmaintained. Anybody picking this project up is very welcome.

A lot of other solutions have been provided by the community, just check which one you like most.

acra's People

Contributors

bnchdrff avatar bod avatar c-romeo avatar chkwok avatar denbond7 avatar deniszhadan avatar dependabot[bot] avatar dougnazar avatar drewis avatar dsotm-pf avatar f43nd1r avatar github-actions[bot] avatar gregd avatar insanityonabun avatar janselv avatar jaysoffian avatar jclehner avatar jwriteclub avatar kevingaudin avatar mikehardy avatar milesich avatar moutsosgeorgios avatar npombourcq avatar pyricau avatar renovate-bot avatar renovate[bot] avatar sarbyn avatar str4d avatar william-ferguson-au avatar yuriykulikov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

acra's Issues

Please include free disk space in reports

We've had a few mysterious error reports that we could only reproduce with no free space on the disks.
It would have been handy if the free disk space were in the crash reports.

class not found?

so many ClassNotFoundException reported, but i tested in all our devices. What caused this kind of exception, and I'm using latest acra-4.4.0.jar. help me plz :)

java.lang.ClassNotFoundException: mypackage.App
in loader dalvik.system.PathClassLoader[/mnt/asec/mypackage-1/pkg.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at android.app.Instrumentation.newApplication(Instrumentation.java:942)
at android.app.LoadedApk.makeApplication(LoadedApk.java:461)

DisplayManagerCollector.collectMetrics - bugs in some collection

result.append(collectMetrics(display, "getMetrics"));
result.append(collectMetrics(display, "getRealMetrics"));

both do nothing, because they try to call
DisplayMetrics metrics = display.()
(through reflection)

However, both getMetrics and getRealMetrics are defined as
void (DisplayMetrics outMetrics)

so you get just NoSuchMethodException exception

Anyway, why using so much error-prone reflection, when you can use
if(Build.VERSION.SDK_INT>=16) ...

since Android API 7 or such, dalvik doesn't complain about uknown class at load time, until it tries to execute it. So just target API>=7, and use conditions block with direct method invokations of higher API, and code will be simpler and smaller.

Crash notification is intrusive, recreates itself after dismissing it.

There is crash notification at status bar. Good.

And there're ways to clear notifications: swipe away, or use clear button. Notification is gone then.

However, notification recreates itself after next ACRA initialization.

It looks like notification doesn't delete crash data when removed this way.

Solution: implement deleteIntent on notification, and delete crash data when invoked.
http://developer.android.com/reference/android/app/Notification.html#deleteIntent

Infinite loop if Dialog Option is choosen and the app crashes on onResmue Method of a Activity

Acra Version 4.4.0
Tested on Nexus 7 with Android 4.2.1

If the Dialog option is enabled and the Activity crashes in the onResume() Method, a infinite loop starts. For some reason, the onResume Method is called again and again and everytime the Exception of the first crash is thrown, Acra catches it and again, onResume is called. Only chance to stop it, is to go to the home screen.

I believe (not sure how it is implemented), that the Dialog is created in the context of the current activity. So, the crashed Activity is started again and will fail again in the onResume method.

EmailIntentSender need to be improved

org.acra.sender.EmailIntentSender

When choosing email clients,many other apps appears to be choosen.

Maybe we should use

new Intent(Intent.ACTION_SENDTO,Uri.parse("mailto:[email protected],[email protected]")) 

instead?

I'm now using custom one:

    Uri uri = Uri.parse("mailto:" + ACRA.getConfig().mailTo());
    final Intent emailIntent = new Intent(android.content.Intent.ACTION_SENDTO, uri);
    emailIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
    emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, body);
    mContext.startActivity(emailIntent);

stacktrace file could not be created

My package name is com.myapp.ps,and try ACRA in app,the log is:
11-13 17:40:08.806: D/ACRA(3756): Add user comment to 1352799583000.stacktrace
11-13 17:40:08.880: W/ACRA(3756): User comment not added:
11-13 17:40:08.880: W/ACRA(3756): java.io.FileNotFoundException: /data/data/com.myapp.ps/files/1352799583000.stacktrace: open failed: ENOENT (No such file or directory)
11-13 17:40:08.880: W/ACRA(3756): at libcore.io.IoBridge.open(IoBridge.java:416)
11-13 17:40:08.880: W/ACRA(3756): at java.io.FileInputStream.(FileInputStream.java:78)
11-13 17:40:08.880: W/ACRA(3756): at android.app.ContextImpl.openFileInput(ContextImpl.java:643)
11-13 17:40:08.880: W/ACRA(3756): at android.content.ContextWrapper.openFileInput(ContextWrapper.java:159)
11-13 17:40:08.880: W/ACRA(3756): at org.acra.CrashReportPersister.load(CrashReportPersister.java:63)
11-13 17:40:08.880: W/ACRA(3756): at org.acra.CrashReportDialog$1.onClick(CrashReportDialog.java:171)
11-13 17:40:08.880: W/ACRA(3756): at android.view.View.performClick(View.java:4084)
11-13 17:40:08.880: W/ACRA(3756): at android.view.View$PerformClick.run(View.java:16966)
11-13 17:40:08.880: W/ACRA(3756): at android.os.Handler.handleCallback(Handler.java:615)
11-13 17:40:08.880: W/ACRA(3756): at android.os.Handler.dispatchMessage(Handler.java:92)
11-13 17:40:08.880: W/ACRA(3756): at android.os.Looper.loop(Looper.java:137)
11-13 17:40:08.880: W/ACRA(3756): at android.app.ActivityThread.main(ActivityThread.java:4745)
11-13 17:40:08.880: W/ACRA(3756): at java.lang.reflect.Method.invokeNative(Native Method)
11-13 17:40:08.880: W/ACRA(3756): at java.lang.reflect.Method.invoke(Method.java:511)
11-13 17:40:08.880: W/ACRA(3756): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11-13 17:40:08.880: W/ACRA(3756): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-13 17:40:08.880: W/ACRA(3756): at dalvik.system.NativeStart.main(Native Method)
11-13 17:40:08.880: W/ACRA(3756): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
11-13 17:40:08.880: W/ACRA(3756): at libcore.io.Posix.open(Native Method)
11-13 17:40:08.880: W/ACRA(3756): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
11-13 17:40:08.880: W/ACRA(3756): at libcore.io.IoBridge.open(IoBridge.java:400)
11-13 17:40:08.880: W/ACRA(3756): ... 16 more
11-13 17:40:08.884: V/ACRA(3756): About to start SenderWorker from CrashReportDialog
11-13 17:40:08.911: D/ACRA(3756): Mark all pending reports as approved.
11-13 17:40:08.911: D/ACRA(3756): Looking for error files in /data/data/com.myapp.ps/files
11-13 17:40:08.915: D/ACRA(3756): #checkAndSendReports - start
11-13 17:40:08.919: D/ACRA(3756): Looking for error files in /data/data/com.myapp.ps/files
11-13 17:40:08.931: D/ACRA(3756): #checkAndSendReports - finish

How can I reslove it๏ผŸ

make ReportsCrashes non-required

Hi,

Is there anyway I can use ACRA without @ReportsCrashes attribute on my Application class?

I've look at ACRA.java and it looks like it's not possible:

 public static void init(Application app) {

        if (mApplication != null) {
            throw new IllegalStateException("ACRA#init called more than once");
        }

        mApplication = app;
        mReportsCrashes = mApplication.getClass().getAnnotation(ReportsCrashes.class);
        if (mReportsCrashes == null) {
            log.e(LOG_TAG,
                    "ACRA#init called but no ReportsCrashes annotation on Application " + mApplication.getPackageName());
            return;
        }

    rest of method...

Too many IllegalStateExceptions

It's laudable that ACRA would report incorrect configuration -- during debug. At runtime, ACRA should fail as silently and as gracefully as possible, not crash the application.

Case in point: I'm calling ACRA.init(this) only once in my application object's onCreate() method, and I'm getting this error:

java.lang.RuntimeException: Unable to start receiver com.frogsparks.mytrails.LicenseInstalled: java.lang.RuntimeException: Unable to create application com.frogsparks.mytrails.MyTrailsApp: java.lang.IllegalStateException: ACRA#init called more than once at android.app.ActivityThread.handleReceiver(ActivityThread.java:1809) at android.app.ActivityThread.access$2400(ActivityThread.java:117) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:985) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3687) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.RuntimeException: Unable to create application com.frogsparks.mytrails.MyTrailsApp: java.lang.IllegalStateException: ACRA#init called more than once at android.app.LoadedApk.makeApplication(LoadedApk.java:479) at android.app.ActivityThread.handleReceiver(ActivityThread.java:1783) ... 10 more Caused by: java.lang.IllegalStateException: ACRA#init called more than once at org.acra.ACRA.a(SourceFile:118) at com.frogsparks.mytrails.MyTrailsApp.onCreate(SourceFile:135) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969) at android.app.LoadedApk.makeApplication(LoadedApk.java:476) ... 11 more

It would be nice to have a switch for strict mode (throws IllegalStateException) and shipping/non-strict (does not throw exceptions unless absolutely necessary).

SharedPreference are not send to the google docs

Hi,

I am using ACRA 4.4.0 and everything works fine except that i can not see the sharedPreference in the crash report (in google docs)

I'm working with Android sdk 4.1.2 (API level 16)

Am i missing something?

Empty report with nulls in several fields

I use 4.3.1-snapshot and got 6 sequential reports which contains only time stump, APP_VERSION_NAME and ANDROID_VERSION is null, everything else is empty.

Here is my config:

@ReportsCrashes(
    formKey = "xxx",
    additionalSharedPreferences = { "misc", "sched", "version" },
    mode = ReportingInteractionMode.DIALOG,
    resToastText = R.string.acra_toast_text,
    resDialogText = R.string.acra_dialog_text,
    resDialogIcon = android.R.drawable.ic_dialog_info,
    resDialogTitle = R.string.app_name,
    resDialogCommentPrompt = R.string.acra_dialog_comment_prompt,
    resDialogOkToast = R.string.acra_dialog_ok_toast,
    sendReportsInDevMode = false,
    resDialogEmailPrompt = R.string.acra_email_label,
    logcatFilterByPid = true)

[Question]Why can't I get the logcat eventlogs?

Dear,
I found that I can't get the eventLogs even if I set the customReportContent as below:
customReportContent = { ReportField.PACKAGE_NAME, ReportField.APP_VERSION_CODE, ReportField.ANDROID_VERSION, ReportField.PHONE_MODEL, ReportField.BUILD, ReportField.TOTAL_MEM_SIZE, ReportField.AVAILABLE_MEM_SIZE, ReportField.STACK_TRACE, ReportField.THREAD_DETAILS, ReportField.LOGCAT, ReportField.EVENTSLOG, ReportField.DUMPSYS_MEMINFO}

The android version is 4.0.4 and the version of acra is 4.3.0.

Please kindly help me figure it out.

Thanks

Abner

How to right algorithm to init ACRA?

I have two variants to initialize ACRA:
1)
@OverRide
public void onCreate() {
ACRA.init(this);
super.onCreate();
}

@OverRide
public void onCreate() {
super.onCreate();
ACRA.init(this);
}

I guess the second algorithm is best option, but first used in examples.

Strange reports after upgrading to 4.x

I am using ACRA since one year in my Android without any problems (thanks for the great work). After upgrading to 4.3 (also tested with 4.4) I get strange reports in my Google Docs spreadsheet. The problem is that the stacktraces have nothing to do with my application. For example:

Hisense E860, Android 4.0.3

java.lang.SecurityException: Permission Denial: writing com.android.providers.settings.SettingsProvider uri content://settings/system from pid=2296, uid=10122 requires android.permission.WRITE_SETTINGS
        at android.os.Parcel.readException(Parcel.java:1327)
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:181)
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
        at android.content.ContentProviderProxy.insert(ContentProviderNative.java:415)
        at android.content.ContentResolver.insert(ContentResolver.java:730)
        at android.provider.Settings$NameValueTable.putString(Settings.java:639)
        at android.provider.Settings$System.putString(Settings.java:849)
        at android.provider.Settings$System.putInt(Settings.java:932)
        at com.android.internal.app.RingtonePickerActivity.onClick(RingtonePickerActivity.java:315)
        at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:166)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4424)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
        at dalvik.system.NativeStart.main(Native Method)

or
LG-E400, Android 2.3.6

java.lang.RuntimeException
        at com.lge.provider.Andy_Flex$Andy_FlexOperator.loadOperatorCode(Andy_Flex.java:1182)
        at com.lge.provider.Andy_Flex$Andy_FlexOperator.getOperatorIndex(Andy_Flex.java:963)
        at com.lge.provider.Andy_Flex$Andy_FlexOperator.access$1200(Andy_Flex.java:940)
        at com.lge.provider.Andy_Flex$Andy_FlexInfo.setUserFlexValue(Andy_Flex.java:1525)
        at com.lge.provider.Andy_Flex$Andy_FlexInfo.access$900(Andy_Flex.java:1416)
        at com.lge.provider.Andy_Flex.setUserFlexValue(Andy_Flex.java:823)
        at com.lge.webkit.Andy_UserAgent.initialize(Andy_UserAgent.java:205)
        at com.lge.webkit.Andy_UserAgent.getUaprof(Andy_UserAgent.java:315)
        at android.webkit.FrameLoader.prepareXWapProfile(FrameLoader.java:471)
        at android.webkit.FrameLoader.<init>(FrameLoader.java:97)
        at android.webkit.BrowserFrame.startLoadingResource(BrowserFrame.java:814)
        at android.webkit.BrowserFrame.nativeLoadUrl(Native Method)
        at android.webkit.BrowserFrame.loadUrl(BrowserFrame.java:275)
        at android.webkit.WebViewCore.loadUrl(WebViewCore.java:1636)
        at android.webkit.WebViewCore.access$1400(WebViewCore.java:54)
        at android.webkit.WebViewCore$EventHub$1.handleMessage(WebViewCore.java:990)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:130)
        at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:653)
        at java.lang.Thread.run(Thread.java:1019)

In the first example it seems the exception belongs to an other thread or app, because in the dumpsys column I get (which is OK):

Permission Denial: can't dump meminfo from from pid=2683, uid=10122 without permission android.permission.DUMP

As you can see the exception belongs to pid 2296 and my app has pid 2683, if my understanding is correct.

In the second example, most of the other columns (like app version) are empty or null.

I never get such wrong exceptions for my own only from my users, which is very annoying, because ACRA is configured to show always a notficiation to ask for sending the report. My user base is not very large, but I didn't get such reports never with the older version. After upgrading (3 weeks ago) I already get 5 of this ( 3 of the first example and 2 of the second one).

If you need more informations, feel free to ask.

java.lang.IllegalStateException: ACRA#init called more than once

When a user is using the application and goes to another application after a while - the phone hangs and the app crashes and i get the following logcat.

01-25 00:35:03.430: E/AndroidRuntime(20657): FATAL EXCEPTION: main
01-25 00:35:03.430: E/AndroidRuntime(20657): java.lang.IllegalStateException: ACRA#init called more than once
01-25 00:35:03.430: E/AndroidRuntime(20657): at org.acra.ACRA.init(ACRA.java:121)
01-25 00:35:03.430: E/AndroidRuntime(20657): at com.m7.nomad.NomadApplication.onConfigurationChanged(NomadApplication.java:15)
01-25 00:35:03.430: E/AndroidRuntime(20657): at android.app.ActivityThread.performConfigurationChanged(ActivityThread.java:3473)
01-25 00:35:03.430: E/AndroidRuntime(20657): at android.app.ActivityThread.handleConfigurationChanged(ActivityThread.java:3597)
01-25 00:35:03.430: E/AndroidRuntime(20657): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1232)
01-25 00:35:03.430: E/AndroidRuntime(20657): at android.os.Handler.dispatchMessage(Handler.java:99)
01-25 00:35:03.430: E/AndroidRuntime(20657): at android.os.Looper.loop(Looper.java:137)
01-25 00:35:03.430: E/AndroidRuntime(20657): at android.app.ActivityThread.main(ActivityThread.java:4507)
01-25 00:35:03.430: E/AndroidRuntime(20657): at java.lang.reflect.Method.invokeNative(Native Method)
01-25 00:35:03.430: E/AndroidRuntime(20657): at java.lang.reflect.Method.invoke(Method.java:511)
01-25 00:35:03.430: E/AndroidRuntime(20657): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
01-25 00:35:03.430: E/AndroidRuntime(20657): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
01-25 00:35:03.430: E/AndroidRuntime(20657): at dalvik.system.NativeStart.main(Native Method)

ACRA 4.4.0 .jar is broken

The imports can't be resolved.

Edit: Seems like the ACRA 4.4.0 jar has a dependancy to the 4.3.1 jar, because the imports are working if I copy the jar in my project and don't include the jar as library!

ACRA.getErrorReporter().handleException(null) hangs on Samsung Galaxy S2 with ICS

I have been using ACRA for 20 months or more and didn't see such scary issue. ACRA.getErrorReporter().handleException(null) hangs in my app. I noticed this issue recently on my Samsung Galaxy S2 (updated to ICS) when I'm implementing some function. For those visit this site won't believe this I guess. First I thought I did some mistake but finally I could narrow down a condition that can reproduce this issue, but Samsung Garalxy S2 (ICS 4.0.3) is the only one phone I could reproduce the issue with that code. I have only one ICS phone, I could not reproduce the issue with 2.2 or 2.3 phones. And I could not make it fail on emulator.

I can send/upload a small project which you may be able to reproduce the issue with Samsung Garalxy S2 (ICS). I'm not sure you can, but my Galaxy S2 can.

Description of issue:

ACRA.getErrorReporter().handleException(null) hangs, won't return from it. App stops running.

ACRA's version:

4.3.1 or 4.3.0 (not tested on older versions)

Key to this issue:

Webview, call ACRA.getErrorReporter().handleException(null) in onCreate or onResume. Depends heavily on environment (phone + OS, not sure).

Please let me pass a project and try to run. ICS phone may be able to reproduce the issue.

Thanks in advance.

Ability to supply custom data in callbacks

Sometimes we want to record some state of the application when the crash occurs as opposed to pre-defining the custom data entries with putCustomData.
Currently we do this by calling putCustomData everytime this state changes, but that is inconvenient and also sometimes impossible to do (see issue #13)
It would be much better if we could register some callbacks that ACRA would call when it creates the crash report.

SocketTimeOut - while using ACRA from real device

Device: Samsung Galaxy Ace
Android: 2.2.1

I am getting the below error while using ACRA from the real device whereas the emulator is sending reports with the same code.

10-26 01:42:17.405: D/ACRA(29928): Sending request to http://www.bugsense.com/api/acra?api_key=3041ce56 10-26 01:42:24.687: D/ACRA(29928): SocketTimeOut - increasing time out to 10000 millis and trying again 10-26 01:42:24.992: D/ACRA(29928): SocketTimeOut - increasing time out to 10000 millis and trying again 10-26 01:42:27.695: E/ACRA(29928): Failed to send crash report for 1351195791000-approved.stacktrace 10-26 01:42:27.695: E/ACRA(29928): org.acra.sender.ReportSenderException: Error while sending report to Http Post Form. 10-26 01:42:27.695: E/ACRA(29928): at org.acra.sender.HttpPostSender.send(HttpPostSender.java:139) 10-26 01:42:27.695: E/ACRA(29928): at org.acra.SendWorker.sendCrashReport(SendWorker.java:178) 10-26 01:42:27.695: E/ACRA(29928): at org.acra.SendWorker.checkAndSendReports(SendWorker.java:141) 10-26 01:42:27.695: E/ACRA(29928): at org.acra.SendWorker.run(SendWorker.java:77) 10-26 01:42:27.695: E/ACRA(29928): Caused by: org.apache.http.conn.ConnectTimeoutException: Connect to /74.125.135.121:80 timed out 10-26 01:42:27.695: E/ACRA(29928): at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:121) 10-26 01:42:27.695: E/ACRA(29928): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:153) 10-26 01:42:27.695: E/ACRA(29928): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164) 10-26 01:42:27.695: E/ACRA(29928): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119) 10-26 01:42:27.695: E/ACRA(29928): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:434) 10-26 01:42:27.695: E/ACRA(29928): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555) 10-26 01:42:27.695: E/ACRA(29928): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487) 10-26 01:42:27.695: E/ACRA(29928): at org.acra.util.HttpRequest.sendPost(HttpRequest.java:141) 10-26 01:42:27.695: E/ACRA(29928): at org.acra.sender.HttpPostSender.send(HttpPostSender.java:136) 10-26 01:42:27.695: E/ACRA(29928): ... 3 more

Programmatically disable ACRA

When I'm testing my application, I'd like to switch of ACRA completely, mainly because I want to see any exceptions in the LogCat view. Therefore I'm suggesting to add an option to disable ACRA programmatically.

Error code 500 when submitting to IrisCouch + Acralyzer + acra-storage

I know nothing about couchdb but I followed your installation instructions to the T on the Acralyzer wiki. I get a dashboard and everything seems ok on IrisCouch. I downloaded the ACRA 4.5.0 Feb102013 snapshot jar as per the instructions. However, when I test ACRA in my app (by intentionally throwing an exception), I get the logcat message shown below.

I have been using ACRA for a couple months now and love it; it has worked fine for us using google docs first and then with BugSense for over a month now. I'm just wondering if perhaps these are just symptoms of the alpha state of Acralyzer, etc. or if I'm doing something obviously wrong.

BTW I'm one of the devs for Mupen64Plus-AE, also on github (see my profile).

02-15 21:31:40.253: D/ACRA(22913): Sending request to https://littleguy77.iriscouch.com/acra-mupen/_design/acra-storage/_update/report/b6a2d21b-185a-4610-bbee-9e3796503ab9
02-15 21:31:40.663: E/ACRA(22913): Failed to send crash report for 1360980602000-approved.stacktrace
02-15 21:31:40.663: E/ACRA(22913): org.acra.sender.ReportSenderException: Error while sending JSON report via Http PUT
02-15 21:31:40.663: E/ACRA(22913):  at org.acra.sender.HttpSender.send(HttpSender.java:181)
02-15 21:31:40.663: E/ACRA(22913):  at org.acra.SendWorker.sendCrashReport(SendWorker.java:178)
02-15 21:31:40.663: E/ACRA(22913):  at org.acra.SendWorker.checkAndSendReports(SendWorker.java:141)
02-15 21:31:40.663: E/ACRA(22913):  at org.acra.SendWorker.run(SendWorker.java:77)
02-15 21:31:40.663: E/ACRA(22913): Caused by: java.io.IOException: Host returned error code 500
02-15 21:31:40.663: E/ACRA(22913):  at org.acra.util.HttpRequest.send(HttpRequest.java:139)
02-15 21:31:40.663: E/ACRA(22913):  at org.acra.sender.HttpSender.send(HttpSender.java:178)
02-15 21:31:40.663: E/ACRA(22913):  ... 3 more
02-15 21:31:40.663: D/ACRA(22913): #checkAndSendReports - finish

Suggestion: crash report in dialog for developers

While developing app, developers get lots of crashes.
There's no need to send crash report myself to a database.
I'd rather want to see where it crashed immediately on device's screen.

There would be ACRA run-time option to enable developer mode, only for developer (for example, my app has build-in hidden debug flag, so that it knows when it runs on my device).

In developer mode, ACRA would use DUMP mode, that is, display crash report.

Example:
c

This is shown in dialog proposed in #37
the content of dialog is WebView, so crash report would be converted to nice HTML

Here's proposed function for making the nice-looking HTML:

  public static String stackTraceToHtml(String stack) {
     StringBuilder sb = new StringBuilder();

     Reader rd = new StringReader(stack);
     BufferedReader br = new BufferedReader(rd);
     try{
        for(String ln; (ln=br.readLine())!=null; ) {
           if(!ln.isEmpty()) {
              ln = ln.replace("\t", "   ");
              String h = Html.escapeHtml(ln);
              h = h.replace(" ", "&nbsp;");
              if(!Character.isWhitespace(ln.charAt(0))) {
                 sb.append("<font color='red'>");
                 sb.append(h);
                 sb.append("</font>");
              }else {
                 int e = h.lastIndexOf('(');
                 int s = h.lastIndexOf('.', e);
                 if(s!=-1)
                    s = h.lastIndexOf('.', s-1);
                 if(s!=-1) {
                    ++s;
                    sb.append("<font color='grey'>");
                    sb.append(h.substring(0, s));
                    sb.append("</font>");

                    sb.append("<b>");
                    sb.append(h.substring(s, e));
                    sb.append("</b>");

                    sb.append("&nbsp;<font color='grey'>");
                    sb.append(h.substring(e));
                    sb.append("</font>");
                 }else
                    sb.append(h);
              }
           }
           sb.append("<br>");
        }
     }catch(IOException e){
        e.printStackTrace();
     }
     return sb.toString();
  }

Preference acra.enable instead of acra.disable?

Hi,

I'm configuring my app's Settings Activity and I think it is more user-friendly to have the CheckboxPreference to enable bug reporting, instead of to disable it. That would imply changing "acra.disable" to "acra.enable".

That would also allow to specify other settings (like reporting the Logcat content or the user's E-Mail) depending on this one by using android:dependency.

ACRA loading time

Hi !

I measured the execution of ACRA.init() a few times on my Galaxy Nexus, and it took between 50ms and 180ms.

This means the UI thread is blocked from 4 to 12 frames on application startup. And that's on a galaxy nexus, a pretty good phone.

My "measurement method" was pretty simple and may be biaised:

    @Override
    public void onCreate() {
        super.onCreate();
        long start = System.currentTimeMillis();
        ACRA.init(this);
        Log.d("TEST", "ACRA init in ms: " + (System.currentTimeMillis() - start));
    }

Anyway, I started traceview to get an insight of what's happening, and I then rebuilt ACRA with measurement logs to be more precise (I started traceview in debug which impacts the perfs). Here is what I found out:

SharedPreferences

ACRA.shouldDisableACRA() accounts for ~50% of the init time.

Android loads SharedPreferences in background, so getSharedPreferences() returns immediately.

However, trying to retrieve a value from the preferences is a blocking operation until the preferences are loaded. ACRA.shouldDisableACRA() calls prefs.getBoolean() which waits for the loading in background to complete.

It's worth noting that if you test multiple times, the file may load immediately thanks to file caches.

A simple way to fix this issue is to use a callback mechanism to read the values once the preference is loaded. However, this means handling the fact that we don't know immediately whether ACRA is enabled or not.

Reading the annotation

mApplication.getClass().getAnnotation(ReportsCrashes.class) takes between 5 and 10ms. It can be completely avoided with a few minor changes that enable an alternate programmatic configuration.

Creating the ErrorReporter

new ErrorReporter() takes the rest of the time budget. I didn't measure precisely enough to know what's going on there exactly.

Privacy concern about SETTINGS_SECURE including LOCK_SCREEN_OWNER_INFO

LOCK_SCREEN_OWNER_INFO generally contains full contact information about the user (name and adress, maybe even phone number).

This is very private information which allow easy identification of a given user.
I think ACRA should scrape this information from SETTINGS_SECURE if possible.

ACRA not reporting bugs to my company email account.

Hi Team,

I had been trying to use ACRA to my android app,it's working fine with my personal gmail address but when i'm trying to use my company id but i see that ACRA is posting to below link : https://docs.google.com/spreadsheet/formResponse formkey=dDhlU3Qyd3pHVEFrVjRtRGpXd29ocEE6MQ&ifq,but it was missing my company name in the url.it supposed to be as below :
https://docs.google.com/a/mycompanyname/spreadsheet/viewform?formkey=dDhlU3Qyd3pHVEFrVjRtRGpXd29ocEE6MQ.Please do reply me

Thanks & Regards,
sandeep.

ACRA Crashes on my app

To make a long story short, please see my post on StackOverflow
http://stackoverflow.com/questions/13484559/acra-is-crashing

Bottom line is, I am getting a crash when I start my application:

11-20 19:25:53.093: E/ACRA(16233): ACRA caught a RuntimeException exception for com.skipmorrow.phca. Building report.
11-20 19:25:53.763: D/ApplicationPolicy(716): isStatusBarNotificationAllowed: packageName = com.skipmorrow.phca
11-20 19:25:53.763: E/ACRA(16233): com.skipmorrow.phca fatal error : Unable to create application com.skipmorrow.phca.ACRA: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
11-20 19:25:53.763: E/ACRA(16233): java.lang.RuntimeException: Unable to create application com.skipmorrow.phca.ACRA: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
11-20 19:25:53.763: E/ACRA(16233): at com.skipmorrow.phca.ACRA.onCreate(ACRA.java:89)

SSL vulnerability

This report on common SSL vulnerabilities is doing the rounds today and it cites ACRA in particular : http://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf

"ACRA, an Android library for posting application crash reports to a Google Doc, overrides the default trust manager. Any app using this library is insecure against a man-in-the-middle attack."

Getting OutOfMemoryError

Not sure what cause this error. Also not sure is that a known error/bug, any explanation or help would be appreciated. Device: GT-I9300.

java.lang.OutOfMemoryError
at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:94)
at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:132)
at java.lang.StringBuilder.append(StringBuilder.java:124)
at org.acra.util.HttpRequest.getParamsAsString(HttpRequest.java:225)
at org.acra.util.HttpRequest.getHttpPost(HttpRequest.java:207)
at org.acra.util.HttpRequest.sendPost(HttpRequest.java:133)
at org.acra.sender.HttpPostSender.send(HttpPostSender.java:136)
at org.acra.SendWorker.sendCrashReport(SendWorker.java:178)
at org.acra.SendWorker.checkAndSendReports(SendWorker.java:141)
at org.acra.SendWorker.run(SendWorker.java:77)

missing values

Hi devs,
I incorporated acra into my app and it worked flawlessly, thanks but some of the defaults fields like android version are missing. I'm only getting stacktrace and settings_system, rest all the fields are blank. I have not configured anything else just the basic functioning

Proguard errors even after configuring as per instruction

I am getting the following error after installing the app on the device. I have configured the proguard as per instructions for proguard given in ACRA wiki.

10-30 23:08:13.238: E/AndroidRuntime(12430): FATAL EXCEPTION: main 10-30 23:08:13.238: E/AndroidRuntime(12430): java.lang.NoSuchFieldError: SILENT 10-30 23:08:13.238: E/AndroidRuntime(12430): at java.lang.reflect.Method.getDefaultValue(Native Method) 10-30 23:08:13.238: E/AndroidRuntime(12430): at java.lang.reflect.Method.getDefaultValue(Method.java:337) 10-30 23:08:13.238: E/AndroidRuntime(12430): at org.apache.harmony.lang.annotation.AnnotationFactory.getElementsDescription(AnnotationFactory.java:78) 10-30 23:08:13.238: E/AndroidRuntime(12430): at org.apache.harmony.lang.annotation.AnnotationFactory.<init>(AnnotationFactory.java:118) 10-30 23:08:13.238: E/AndroidRuntime(12430): at org.apache.harmony.lang.annotation.AnnotationFactory.createAnnotation(AnnotationFactory.java:100) 10-30 23:08:13.238: E/AndroidRuntime(12430): at java.lang.Class.getDeclaredAnnotations(Native Method) 10-30 23:08:13.238: E/AndroidRuntime(12430): at java.lang.Class.getAnnotations(Class.java:322) 10-30 23:08:13.238: E/AndroidRuntime(12430): at java.lang.Class.getAnnotation(Class.java:292) 10-30 23:08:13.238: E/AndroidRuntime(12430): at org.acra.ACRA.init(SourceFile:122) 10-30 23:08:13.238: E/AndroidRuntime(12430): at com.myapp.thisapp.MyApplication.onCreate(SourceFile:19) 10-30 23:08:13.238: E/AndroidRuntime(12430): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969) 10-30 23:08:13.238: E/AndroidRuntime(12430): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4250) 10-30 23:08:13.238: E/AndroidRuntime(12430): at android.app.ActivityThread.access$3000(ActivityThread.java:126) 10-30 23:08:13.238: E/AndroidRuntime(12430): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2076) 10-30 23:08:13.238: E/AndroidRuntime(12430): at android.os.Handler.dispatchMessage(Handler.java:99) 10-30 23:08:13.238: E/AndroidRuntime(12430): at android.os.Looper.loop(Looper.java:123) 10-30 23:08:13.238: E/AndroidRuntime(12430): at android.app.ActivityThread.main(ActivityThread.java:4633) 10-30 23:08:13.238: E/AndroidRuntime(12430): at java.lang.reflect.Method.invokeNative(Native Method) 10-30 23:08:13.238: E/AndroidRuntime(12430): at java.lang.reflect.Method.invoke(Method.java:521) 10-30 23:08:13.238: E/AndroidRuntime(12430): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) 10-30 23:08:13.238: E/AndroidRuntime(12430): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 10-30 23:08:13.238: E/AndroidRuntime(12430): at dalvik.system.NativeStart.main(Native Method)

I could get rid of the errors by adding the following line

-keep public class org.acra.** {*;}

Why so?

called more than once

util.acra.AcraApplication: java.lang.IllegalStateException: ACRA#init called more than once

BOARD=7x27
BOOTLOADER=unknown
BRAND=qcom
CPU_ABI=armeabi-v7a

No folder "CrashReport"

Wiki of the library states "Import the CrashReports-template.csv contained in the archive (acra-4.X.Y/CrashReport/doc), with conversion enabled". But in 4.3.0 there is no folder named "CrashReport"

Add E-Mail Address field to the Crash Report Dialog.

I have been asking my users to add their e-mail address to the comments section of the crash report dialog , It would be a good idea to have the e-mail address as a separate entry on that dialog, with the option to turn it on/off..

Filter crash

Hi,

Is there a way to disable ACRA reporting for one specific crash ? (Or when it can't get APP_VERSION_CODE)
My app use a widget that can be updated every second and when users update my app some times it crashes since the app is not yet finished updating.

This leads to reports containing :
APP_VERSION_CODE=null
APP_VERSION_NAME=Package info unavailable

Those are easy to filter on my side but this lead users sends reports (I use mail reports) and think there's a problem when there's not.

Dialog button text customisation

Hi there,

Is there any way I can customise the text for the Dialog that appears every time an exception is caught? Currently, in the CrashReportDialog class I see that the text for the two buttons is the default android.R.string.yes and android.R.string.no . I would like to substitute these if possible with "Send" and "No thanks" instead. Is it possible for another setter method to be added to the ACRAConfiguration object, to allow this ?

Please update the ProGuard How-To

Followed the ProGuard How-To posted here:

http://code.google.com/p/acra/wiki/ACRAProGuardHowTo

but when building my project, I am getting the following 3 ACRA related problems:

[proguard] Note: org.acra.collector.MediaCodecListCollector accesses a method 'isEncoder()' dynamically
[proguard] Maybe this is library method 'android.media.MediaCodecInfo { boolean isEncoder(); }'
[proguard] Note: the configuration refers to the unknown class 'org.acra.ErrorReporter$ReportsSenderWorker'
[proguard] Note: the configuration keeps the entry point 'org.acra.ACRA { void setConfig(org.acra.ACRAConfiguration); }', but not the descriptor class 'org.acra.ACRAConfiguration'

I am not sure if these are real problems, but ACRA shouldn't "pollute" the build log as it's hard to see if there are real errors, if any.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.