Android Crash Reporting Tools Force a Test Crash With Fabric

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Add a button you can tap to trigger a crash. Paste this code into your layout where you’d like the button to appear.

<Button
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:text="Force Crash!"
    android:onClick="forceCrash"
    android:layout_centerVertical="true"
    android:layout_centerHorizontal="true" />

Throw a RuntimeException

public void forceCrash(View view) {
    throw new RuntimeException("This is a crash");
}

Run your app and tap the new button to cause a crash. In a minute or two you should be able to see the crash on your Crashlytics dashboard as well as you will get a mail.



Got any Android Question?