Check out example codes for "Error inflating class android.support.constraint.ConstraintLayout". It will help you in understanding the concepts better.

Code Example 1

For those who are switching from android support to androidx, 
remember to change 
android.support.constraint.ConstraintLayout 
to
androidx.constraintlayout.widget.ConstraintLayout

Learn ReactJs, React Native from akashmittal.com