Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 659
Ho jun Avatar asked Aug 10 '17 13:08

Ho jun


2 Answers

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)

like image 191
Saurabh Thorat Avatar answered Nov 10 '22 03:11

Saurabh Thorat


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'
like image 45
Harshit Trivedi Avatar answered Nov 10 '22 01:11

Harshit Trivedi