Skip to main content

Test it

Let's crash your app to see what the crash report looks like on your Shake dashboard.

You're viewing the Android docs. Other platform → iOS 

Crash your app

Enable crash reporting and paste this code to the onCreate method in one of your activities. It will crash your app when you tap a button by accessing the array with the out-of-bounds index:

MainActivity.kt
public class MainActivity : Activity {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val buttonCrash: Button = findViewById(R.id.button_crash)
buttonCrash.setOnClickListener {
val array = arrayOf(1, 2, 3)
val result = array[5]
}
}
}

Reopen your app, describe the crash and tap Submit.

Visit your Shake dashboard

To see your crash report:

  1. Visit your Shake dashboard
  2. Switch to the Crash reports tab in the left sidebar

If your crash report is not visible instantly, wait a minute until the system processes it.