Gradle Sync failed could not find constraint-layout:1.0.0-alpha2

Support libraries for ConstraintLayout could not be installed/updated.

Just open Preferences > Appearance & Behavior > System Settings > Android and move to SDK Tools tab. Check the following fields and install.

Preferences


In my case, that support libraries for ConstraintLayout were installed, but I was adding the incorrect version of ConstraintLayout Library in my build.gradle file. In order to see what version have you installed, go to Preferences > Appearance & Behavior > System Settings > Android SDK. Now, click on SDK Tools tab in right pane. Check Show Package Details and take note of the version.

enter image description here

Finally you can add the correct version in the build.gradle file

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha9'
    testCompile 'junit:junit:4.12'
}

The fix is to update the android gradle plugin in your build.gradle.

This should work: classpath 'com.android.tools.build:gradle:2.2.0-alpha2'

Or you can use the latest: classpath 'com.android.tools.build:gradle:2.2.0-alpha3'