rohit_g
rohit_g

Reputation: 11

failed to resolve com.android.support.constraint:constraint-layout:2.0.0-alpha4

I imported a project from my work-space. After this some errors were shown which I can't solve.

enter image description here

The message

Install Repository and sync project

was shown as a link, but clicking on it didn't solve my problem.

Upvotes: 0

Views: 7219

Answers (2)

Oywj
Oywj

Reputation: 11

Add ConstraintLayout to your project.

To use ConstraintLayout in your project, proceed as follows:

  1. Ensure you have the "maven.google.com" repository declared in your module-level build.gradle file:

    repositories {
        maven {
            url 'https://maven.google.com'
        }
    }
    
  2. Add the library as a dependency in the same build.gradle file:

    dependencies {
        compile 'com.android.support.constraint:constraint-layout:1.0.2'
    }
    
  3. In the toolbar or sync notification, click Sync Project with Gradle Files.

Upvotes: 1

David Seroussi
David Seroussi

Reputation: 1710

The constraintLayout is not available yet on any stable relase of Android Studio. You have to download the latest Android Studio Preview to use it.

Upvotes: 0

Related Questions