-1

Failed to resolve: com.android.support.constraint:constraint-layout:1.0.2 I see this error when I open my projectI cant install constraint-layout:1.0.2, there is some error strong text

Aj 27
  • 2,316
  • 21
  • 29
  • possible duplicate of https://stackoverflow.com/questions/43017930/android-studio-gradle-errorfailed-to-resolve-com-android-support-constraintc – Ali Faris Jan 29 '18 at 14:46
  • might help https://stackoverflow.com/questions/37992187/gradle-sync-failed-could-not-find-constraint-layout1-0-0-alpha2 – Levon Petrosyan Jan 29 '18 at 14:47

3 Answers3

1

Your project's build.gradle should have the content as below. All the Google specific dependencies are now hosted on their own Maven Repository.

If you still find it confusing, just create a new Project from scratch using Android Studio 3.0.1 and all the dependencies would be properly configured.

buildscript {

    repositories {
        google() // Speficically this entry
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
    }
}
anemo
  • 1,327
  • 1
  • 14
  • 28
0

First of all, make sure to update your Android Studio. Second thing, make sure you import the Google maven repository into your project gradle file. Then, you should be able to install ConstraintLayout.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Lodoss
  • 469
  • 4
  • 11
0

Here's the solution:

repositories {
maven {
    url 'https://maven.google.com'
}

} then add this line in dependencies:

compile 'com.android.support.constraint:constraint-layout:1.0.2' compile 'com.android.support.constraint:constraint-layout-solver:1.0.2'