Mr. X
Mr. X

Reputation: 19

Failed to find:com.android.support:design:26.0.1

I want to use AppBarLayout and CoordinateLayout for my Android project so, I added compile 'com.android.support:design:26.0.1' to the gradle dependencies. But I'm getting an error all the time as Failed to find:com.android.support:design:26.0.1. and if I try choose the install repository and sync again option, nothing is happening.

I think my SDK is pretty much update!

How to get rid of it and be able to add the layouts ?

Upvotes: 0

Views: 1256

Answers (5)

Droid Teahouse
Droid Teahouse

Reputation: 1013

Another reason for this is not upgrading to the latest gradle, but if you are using AS 2.3.3 you need a work-around as well.

I am targeting/compiling with

android version 26

First update your gradle: https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html says to

update the URL in gradle-wrapper.properties as follows:

distributionUrl=\
 https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip

I also had to add:

maven {
            url 'https://maven.google.com'
            // Alternative URL is 'https://dl.google.com/dl/android/maven2/'
        }

(google() does not work for me before updating) and run

./gradlew --stop

from project root This caused the manual gradle download to start.

I had to copy the downloaded folder

(~/.gradle/wrapper/dists/gradle-4.1-rc-1-all/gradle-4.1-rc-1) 

to

"/Applications/Android Studio app/Contents/gradle/gradle-4.1-rc-1" 

AS may ask you to update this in the gradle console window as well (it will provide a link where you can choose the new version)

I also had to update any library entries:

 compile project(path: ':<my-lib>', configuration: 'default')

The workaround involves downgrading the plugin to

 classpath 'com.android.tools.build:gradle:2.3.3' 

as per https://github.com/firebase/quickstart-android/issues/294 Finally, it builds..... sheesh.

Upvotes: 0

G00fY
G00fY

Reputation: 5317

Starting with Gradle 4.0 (works with upcoming Android Studio 3) you are also able to just add:

 repositories {
     ...
     google()
 }

See official Gradle docs

Upvotes: 0

Anshul..
Anshul..

Reputation: 66

try this

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

Upvotes: 1

Piotr Golinski
Piotr Golinski

Reputation: 1000

Add this to your gradle file:

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

Upvotes: 1

Satan Pandeya
Satan Pandeya

Reputation: 3815

From the documentation, make sure you have include a maven section with the https://maven.google.com endpoint.

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

Upvotes: 1

Related Questions