Reputation: 161
Error:Failed to resolve: com.android.support.constraint:constraint-layout-solver:1.0.2
Install artifact and sync project
Open File
Show in Project Structure dialog
Upvotes: 16
Views: 33485
Reputation: 799
You need to activate Auto Import Packages and Components to use, so On welcome to Android Studio Popup Window see on the bottom > click configure > preference or setting (on Windows OS) > Find Editor > General > Auto Import > Change Insert Imports on paste to All, and thick checkbox Add unambiguous import on the fly. And you also need to check installed SDK Platforms on your machine, position still on setting page, find Appearance and Behaviour > System Setting > Android SDK > and you need Pick Android 5.0 (Lollipop) until Android 7.0 (Nougat) the latest one if you prefer > click apply > And you will be asked to download > as all finish you will be find to go.
Upvotes: 1
Reputation: 3924
I have also faced the same error. I updated my android constraint-layout version to 1.0.1(com.android.support.constraint:constraint-layout:1.0.1) from 1.0.2 and it is working now.
build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
testCompile 'junit:junit:4.12'
}
Upvotes: 4
Reputation: 1954
first add google maven repository in module level gradle file(important part)
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'
Upvotes: 15
Reputation: 6679
I encountered this problem as well. It was perplexing to me because the SDK manager showed both ConstraintLayout and its solver as installed. What I did to solve it was the following:
The next time you refresh your gradle projects, everything should work just fine!
Upvotes: 17
Reputation: 219
go to file>settings>Android sdk>sdk Tools>and update your support repository that fixed my problem
Upvotes: 21