Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio fails to resolve repository

In my project, I'm trying to use the design support library. I have in my Gradle file:

dependencies {
    ....
    compile 'com.android.support:design'
    ....
}

And when I try to build this, I get the error:

enter image description here

Normally I would just click Install Repository and sync project, however, this seems to not work anymore. Clicking this does absolutely nothing, even though clicking Open File works fine.

How can I manually install it?

I have the latest Android Support Repository (30.0.0), and Android Support Library (23.2.1) installed.

like image 585
Timestretch Avatar asked Apr 19 '16 12:04

Timestretch


2 Answers

For me the solution was to add maven in the allprojects section. From the setup document: https://developer.android.com/topic/libraries/support-library/setup.html

in the project level settings.gradle file.

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

Then double check the document for the latest version. In the app level of the settings.gradle file add:

dependencies{
    compile 'com.android.support:design:26.0.1'
}

And use Gradle to sync the project.

like image 144
Chad H. Avatar answered Sep 16 '22 21:09

Chad H.


I think it is because you've not specified the version.

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

change version to what you have downloaded.

like image 28
AndroidMechanic - Viral Patel Avatar answered Sep 16 '22 21:09

AndroidMechanic - Viral Patel