11

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.

Amit Vaghela
  • 22,772
  • 22
  • 86
  • 142
Brandon Slaght
  • 1,025
  • 1
  • 12
  • 34
  • are you connected to the internet with proper proxy settings (if any) for android studio? – Viral Patel Apr 19 '16 at 12:51
  • Try with Giving this `compile 'com.android.support:design:22.2.0'`. – Jay Rathod Apr 19 '16 at 12:53
  • @jaydroider This technically works, because I think I have used that version previously. However I am targeting api 19 and when I try to use `:19.0.0` it gives me the same error. Is that the proper version for me to be trying? – Brandon Slaght Apr 19 '16 at 12:58
  • @AndroidMechanic Yes. The sdk manager has no problem updating packages. – Brandon Slaght Apr 19 '16 at 13:00
  • @Timestretch What is your `compileSdkVersion`. Depend on that try to set whichever version is currently available. – Jay Rathod Apr 19 '16 at 13:00
  • @jaydroider compileSdk is 19, build tools version is 23.0.3, min sdk is 19, and target sdk is also 19. – Brandon Slaght Apr 19 '16 at 13:06
  • See this link, uninstall android APP and SDK, it works for me. http://stackoverflow.com/questions/17625622/how-to-completely-uninstall-android-studio – Mike Yang Apr 03 '17 at 06:46

3 Answers3

5

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.

Chad H.
  • 121
  • 1
  • 5
4

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.

Viral Patel
  • 32,418
  • 18
  • 82
  • 110
1

You can go File->Settings->Gradle Look at the "Offline work" inbox,

If it's checked you can uncheck and try to sync again.

Amit Vaghela
  • 22,772
  • 22
  • 86
  • 142