My app crashed because
Error inflating class android.support.design.widget.FloatingActionButton
This is my code in the XML
Make sure the library from which you declared the FloatingActionButton in the activity is the same as the one used for the layout markup
For example have
import com.google.android.material.floatingactionbutton.FloatingActionButton; in the activity and com.google.android.material.floatingactionbutton.FloatingActionButton as the tag for the layout