Ho jun
Ho jun

Reputation: 93

Android studio - Faild to resolve: com.android.support:design:26.0.1 error

I have an error called:

 "Failed to resolve: com.android.support:design:26.0.1".

My android studio version is 3.0 beta 1.

My gradle file is as below:

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
    applicationId "hojune.example"
    minSdkVersion 17
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
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.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:26.0.1'
}

I want to put "design" to my project, but I can't do it. How can I do it?

Upvotes: 7

Views: 11120

Answers (5)

Usman Rasool
Usman Rasool

Reputation: 1

I solved it by replacing

compile 'com.android.support:design:26.0.1' 

with

compile 'com.android.support:design:26.0.0-alpha1'

Upvotes: 0

Saurabh Thorat
Saurabh Thorat

Reputation: 20734

Add this to your project level build.gradle file:

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

Just to clarify, this should be in the "allprojects" section of the gradle file (Thanks to @tys)

Upvotes: 45

Kishan Donga
Kishan Donga

Reputation: 3203

According to the comment of @Muthukrishnan Rajendran is right google already release 26.0.1 version so a problem in your way of building. If you using android studio 3.0 then you need to read this documentation please refer this link https://androidstudio.googleblog.com/2017/05/android-studio-30-canary-1-sdk-updates.html here specified maven.google.com are now available so you need to added below line of code

allprojects {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
    }
} 

for the above gradle change you need to refer this document https://developer.android.com/topic/libraries/architecture/adding-components.html

also required to change if your project is old

dependencies {
   classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
}

Upvotes: 1

Adil B
Adil B

Reputation: 144

I had the same problem i solved it by using

compile 'com.android.support:design:26.0.0-alpha1'

Upvotes: 3

Harshit Trivedi
Harshit Trivedi

Reputation: 782

Try to Change

buildToolsVersion "26.0.0"

and

com.android.support:design:26.0.0

Or not change into bulidToolsVersion Change dependencies

compile 'com.android.support:design:26.0.0-alpha1'

Upvotes: 5

Related Questions