我遵循本教程 - https://www.toptal.com/android/automated-android-crash-reports-with-acra-and-cloudant到后者。
这是我的配置:
@ReportsCrashes(
formUri = "https://ofektest.cloudant.com/acra-apptest/_design/acra-storage/_update/report",
reportType = HttpSender.Type.JSON,
httpMethod = HttpSender.Method.POST,
formUriBasicAuthLogin = "***", // from the permissions API key generated
formUriBasicAuthPassword = "***", // from the permissions API key generated
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 HealthCheckerApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
ACRA.init(this);
}
}
在我的主要活动中,我故意使用此代码使应用程序崩溃并出现空异常:就像示例一样
String crashString = null;
crashString.length();
我在应用程序中看到了crash
Toast,但是当我转到我的仪表板时,我看不到任何错误/报告/任何东西!
我怎样才能看到错误?和崩溃报告?
编辑:这是我logcat
的崩溃后:
06-23 18:47:06.493 24779-24779/com.ofekagmon.apps.healthchecker W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x4165adb8)
06-23 18:47:06.493 24779-24779/com.ofekagmon.apps.healthchecker E/ACRA: ACRA caught a NullPointerException for com.ofekagmon.apps.healthchecker
06-23 18:47:06.493 24779-24779/com.ofekagmon.apps.healthchecker E/ACRA: java.lang.NullPointerException
06-23 18:47:06.493 24779-24779/com.ofekagmon.apps.healthchecker E/ACRA: at com.ofekagmon.apps.healthchecker.ui.activities.HomeActivity.startService(HomeActivity.java:47)
06-23 18:47:06.493 24779-24779/com.ofekagmon.apps.healthchecker E/ACRA: at com.ofekagmon.apps.healthchecker.ui.activities.HomeActivity$$ViewBinder$1.doClick(HomeActivity$$ViewBinder.java:24)
06-23 18:47:06.493 24779-24779/com.ofekagmon.apps.healthchecker E/ACRA: at butterknife.internal.DebouncingOnClickListener.onClick(DebouncingOnClickListener.java:22)
06-23 18:47:06.493 24779-24779/com.ofekagmon.apps.healthchecker E/ACRA: at android.view.View.performClick(View.java:4445)
06-23 18:47:06.493 24779-24779/com.ofekagmon.apps.healthchecker E/ACRA: at android.view.View$PerformClick.run(View.java:18446)
06-23 18:47:06.493 24779-24779/com.ofekagmon.apps.healthchecker E/ACRA: at android.os.Handler.handleCallback(Handler.java:733)
06-23 18:47:06.493 24779-24779/com.ofekagmon.apps.healthchecker E/ACRA: at android.os.Handler.dispatchMessage(Handler.java:95)
06-23 18:47:06.493 24779-24779/com.ofekagmon.apps.healthchecker E/ACRA: at android.os.Looper.loop(Looper.java:136)
06-23 18:47:06.493 24779-24779/com.ofekagmon.apps.healthchecker E/ACRA: at android.app.ActivityThread.main(ActivityThread.java:5146)
06-23 18:47:06.493 24779-24779/com.ofekagmon.apps.healthchecker E/ACRA: at java.lang.reflect.Method.invokeNative(Native Method)
06-23 18:47:06.493 24779-24779/com.ofekagmon.apps.healthchecker E/ACRA: at java.lang.reflect.Method.invoke(Method.java:515)
06-23 18:47:06.493 24779-24779/com.ofekagmon.apps.healthchecker E/ACRA: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
06-23 18:47:06.493 24779-24779/com.ofekagmon.apps.healthchecker E/ACRA: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
06-23 18:47:06.493 24779-24779/com.ofekagmon.apps.healthchecker E/ACRA: at dalvik.system.NativeStart.main(Native Method)
06-23 18:47:08.603 24779-25247/? I/Process: Sending signal. PID: 24779 SIG: 9