我已将Firebase集成到本机Android应用中。
使用Crashlytics.getInstance.crash()手动调用崩溃可在Firebase中正确生成报告。
我试图在代码中添加零除,并且还收到了崩溃报告。
我的越野车代码中发生的实际崩溃未报告。
下面是两次崩溃的比较:
以下是Crashlytics / CrashTest崩溃的日志记录:
2019-09-23 13:48:13.171 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.emorphis.sensoria, PID: 20765
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.emorphis.sensoria/com.emorphis.sensoria.activities.MainActivity}: java.lang.ArrayIndexOutOfBoundsException: length=2; index=10
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3086)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3229)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1926)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:6981)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=2; index=10
at com.crashlytics.android.core.CrashTest.indexOutOfBounds(CrashTest.java:30)
at com.crashlytics.android.core.CrashlyticsCore.crash(CrashlyticsCore.java:635)
at com.crashlytics.android.Crashlytics.crash(Crashlytics.java:340)
at com.emorphis.sensoria.activities.MainActivity.onCreate(MainActivity.java:615)
at android.app.Activity.performCreate(Activity.java:7326)
at android.app.Activity.performCreate(Activity.java:7317)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3066)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3229)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1926)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:6981)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
以及随后的崩溃报告:
2019-09-23 13:48:58.198 D/ViewRootImpl@8dc0111[SplashActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1080, 2220) ci=Rect(0, 63 - 0, 126) vi=Rect(0, 63 - 0, 126) or=1
2019-09-23 13:48:59.055 W/CrashlyticsCore: No minidump data found in directory /data/user/0/com.emorphis.sensoria/files/.Fabric/com.crashlytics.sdk.android.crashlytics-ndk/native/1569271682474
2019-09-23 13:49:00.169 I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2019-09-23 13:49:00.169 I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2019-09-23 13:49:01.066 I/CrashlyticsCore: Crashlytics report upload complete: 5D892F820293-0001-511D-F5FD01AE9D9E
这是实际的错误崩溃:
2019-09-23 14:35:35.529 E/AndroidRuntime: FATAL EXCEPTION: Timer-1
Process: com.emorphis.sensoria, PID: 21261
java.lang.NullPointerException: Attempt to read from null array
at com.sensoria.sensorialibrary.SASensoriaControlPointService.getChargingState(SASensoriaControlPointService.java:358)
at com.emorphis.sensoria.activities.MainActivity$9.run(MainActivity.java:1217)
at java.util.TimerThread.mainLoop(Timer.java:562)
at java.util.TimerThread.run(Timer.java:512)
2019-09-23 14:35:36.032 I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2019-09-23 14:35:36.032 I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2019-09-23 14:35:36.051 I/Process: Sending signal. PID: 21261 SIG: 9
及随后的报告,据称是成功的。
2019-09-23 14:37:39.740 D/ViewRootImpl@d7ec077[SplashActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1080, 2220) ci=Rect(0, 63 - 0, 126) vi=Rect(0, 63 - 0, 126) or=1
2019-09-23 14:37:40.414 W/CrashlyticsCore: No minidump data found in directory /data/user/0/com.emorphis.sensoria/files/.Fabric/com.crashlytics.sdk.android.crashlytics-ndk/native/1569271838332
2019-09-23 14:37:41.478 I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2019-09-23 14:37:41.478 I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2019-09-23 14:37:42.380 I/CrashlyticsCore: Crashlytics report upload complete: 5D89301E020A-0001-530D-F5FD01AE9D9E
但是我看不到Firebase中的第二个事件。 不确定出什么问题。