崩溃报告已根据 logcat 发送但未显示在 Arcalyzer 仪表板中?

Crash reports sent according to logcat but didn't show in Arcalyzer Dashboard?

我正在创建算术异常以使用 ARCA 接收崩溃报告。我已经使用 arcalyzer 在 Cloudant 设置了后端。崩溃后,根据 logcat,崩溃报告已发送,但 arcalyzer 仪表板上未显示任何报告。 无法弄清楚这段代码有什么问题。

主应用程序:

@ReportsCrashes(
    formUri = "https://terrybogard911.cloudant.com/acra-faheemcallrecorder/_design/acra-storage/_update/report",
    reportType = HttpSender.Type.JSON,
    httpMethod = HttpSender.Method.POST,
    formUriBasicAuthLogin = ""//Login,
    formUriBasicAuthPassword = ""//Password,
    customReportContent = {
            ReportField.APP_VERSION_CODE,
            ReportField.APP_VERSION_NAME,
            ReportField.ANDROID_VERSION,
            ReportField.PACKAGE_NAME,
            ReportField.REPORT_ID,
            ReportField.BUILD,
            ReportField.STACK_TRACE
    },
    mode = ReportingInteractionMode.TOAST,
    resToastText = R.string.toast_crash

)
public class MainApp extends Application {

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

Logcat:

09-14 01:32:08.546 19876-19876/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder E/ACRA: ACRA caught a ArithmeticException for com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder
                                                                                                                                                      java.lang.ArithmeticException: divide by zero
                                                                                                                                                          at com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder.MainActivity.onOptionsItemSelected(MainActivity.java:228)
                                                                                                                                                          at android.app.Activity.onMenuItemSelected(Activity.java:2644)
                                                                                                                                                          at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:408)
                                                                                                                                                          at android.support.v7.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:195)
                                                                                                                                                          at android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:113)
                                                                                                                                                          at android.support.v7.app.AppCompatDelegateImplV9.onMenuItemSelected(AppCompatDelegateImplV9.java:679)
                                                                                                                                                          at android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:822)
                                                                                                                                                          at android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:156)
                                                                                                                                                          at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:969)
                                                                                                                                                          at android.support.v7.view.menu.MenuPopup.onItemClick(MenuPopup.java:127)
                                                                                                                                                          at android.widget.AdapterView.performItemClick(AdapterView.java:299)
                                                                                                                                                          at android.widget.AbsListView.performItemClick(AbsListView.java:1158)
                                                                                                                                                          at android.widget.AbsListView$PerformClick.run(AbsListView.java:2957)
                                                                                                                                                          at android.widget.AbsListView.run(AbsListView.java:3849)
                                                                                                                                                          at android.os.Handler.handleCallback(Handler.java:733)
                                                                                                                                                          at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                                                                                          at android.os.Looper.loop(Looper.java:136)
                                                                                                                                                          at android.app.ActivityThread.main(ActivityThread.java:5107)
                                                                                                                                                          at java.lang.reflect.Method.invokeNative(Native Method)
                                                                                                                                                          at java.lang.reflect.Method.invoke(Method.java:515)
                                                                                                                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
                                                                                                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
                                                                                                                                                          at dalvik.system.NativeStart.main(Native Method)
09-14 01:32:08.546 19876-19876/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/ACRA: Building report
09-14 01:32:08.556 19876-19876/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/ACRA: Using custom Report Fields
09-14 01:32:08.646 19876-19876/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder I/ACRA: READ_LOGS granted! ACRA can include LogCat and DropBox data.
09-14 01:32:08.646 19876-19876/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/ACRA: Writing crash report file 1505334728000.stacktrace.
09-14 01:32:08.656 19876-19876/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/ACRA: About to start ReportSenderWorker from #handleException
09-14 01:32:08.666 19876-20036/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/ACRA: Mark all pending reports as approved.
09-14 01:32:08.666 19876-20036/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/ACRA: Looking for error files in /data/data/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder/files
09-14 01:32:08.676 19876-20036/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/ACRA: #checkAndSendReports - start
09-14 01:32:08.696 19876-20037/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/ACRA: Waiting for 2000 millis from 1505334728625 currentMillis=1505334728707
09-14 01:32:08.696 19876-20039/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/ACRA: Waiting for Toast
09-14 01:32:08.696 19876-20036/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/ACRA: Looking for error files in /data/data/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder/files
09-14 01:32:08.696 19876-20036/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder I/ACRA: Sending file 1505334728000-approved.stacktrace
09-14 01:32:08.766 19876-20036/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/ACRA: Connect to https://terrybogard911.cloudant.com/acra-faheemcallrecorder/_design/acra-storage/_update/report
09-14 01:32:08.796 19876-20036/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/ACRA: Sending request to https://terrybogard911.cloudant.com/acra-faheemcallrecorder/_design/acra-storage/_update/report
09-14 01:32:08.806 19876-20036/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder E/DataScheduler: isDataSchedulerEnabled():false
09-14 01:32:09.576 19876-20036/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder V/TlsSniSocketFactory: Setting allowed TLS protocols: TLSv1, TLSv1.1, TLSv1.2
09-14 01:32:09.576 19876-20036/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder V/TlsSniSocketFactory: Setting allowed TLS ciphers: TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, SSL_RSA_WITH_RC4_128_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, TLS_ECDHE_RSA_WITH_RC4_128_SHA, TLS_ECDH_ECDSA_WITH_RC4_128_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV, TLS_ECDH_RSA_WITH_RC4_128_SHA, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_RC4_128_MD5, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA
09-14 01:32:09.576 19876-20036/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/TlsSniSocketFactory: Using documented SNI with host name terrybogard911.cloudant.com
09-14 01:32:10.266 19876-20036/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder I/TlsSniSocketFactory: Established TLSv1.2 connection with terrybogard911.cloudant.com using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
09-14 01:32:10.636 19876-20036/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/ACRA: #checkAndSendReports - finish
09-14 01:32:10.706 19876-20039/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/ACRA: Finished waiting for Toast
09-14 01:32:10.706 19876-20039/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/ACRA: Waiting for Worker
09-14 01:32:10.706 19876-20039/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/ACRA: Finished waiting for Worker
09-14 01:32:10.706 19876-20039/com.tookmesomuchtime.javaprogramming.rashidfaheem.hybridsoftwaresolutions.hbss.rashidfaheem.faheemcallrecorder D/ACRA: Wait for Toast + worker ended. Kill Application ? true

添加这个版本

dependencies {
    testCompile 'junit:junit:4.12'
    compile 'ch.acra:acra:4.9.2'
}

不要忘记添加

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

在以下覆盖方法中添加 ACRA init

    @Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);

    // The following line triggers the initialization of ACRA
    ACRA.init(this);
    System.out.println("application initialized  ACRA");
}

W/ACRA: 403: Client error - request will be discarded

这意味着已访问服务器但拒绝该操作。

可能的原因包括:

  • 您的身份验证是针对没有所需角色(reporter)的用户
  • 由于错误的 https 配置,服务器拒绝了连接

Http 403 Forbidden