私はこのチュートリアルに従いました - https://www.toptal.com/android/automated-android-crash-reports-with-acra-and-cloudantを後者に。
アプリのデータベースと acralyzer を作成しました。
これは私の構成です:
@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);
}
}
私の主な活動では、このコードでnull 例外を使用して意図的にアプリをクラッシュさせます:例のように
String crashString = null;
crashString.length();
アプリにトーストが表示crash
されますが、ダッシュボードに移動すると、バグ/レポート/何も表示されません!
どうすればバグを見ることができますか? とクラッシュレポート?
編集: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