Force a Test Crash With Fabric

suggest change

Add a button you can tap to trigger a crash. Paste this into the layout where the button should appear. layout_centerVertical and layout_centerHorizontal apply when the parent is a RelativeLayout.

<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 the app and tap the button. After Crashlytics uploads the report, the crash appears on the dashboard and Crashlytics sends an email.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents