To work with ConstraintLayout, you need Android Studio Version 2.2 or newer and have at least version 32 (or higher) of Android Support Repository.
Add the Constraint Layout library as a dependency in your build.gradle file:
dependencies {
compile 'com.android.support.constraint:constraint...