Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Gradle cannot find 'com.android.support:design:22.2.0' (the Android Design Support Library)

This issue has been incredibly frustrating for me for the past two weeks.

Using the Android SDK Manager, I updated the following:

Tools:

Android SDK Tools rev. 24.3.3
Android SDK Platform-tools rev. 22
Android SDK Build-tools rev. 22.0.1

Android 5.1.1 (API 22):

SDK Platform rev. 2
Google APIs rev. 1
Sources for Android SDK rev. 1

Extras:

Android Support Repository rev. 16
Android Support Library rev. 22.2.1
Google Repository rev.22

This is the exact list of all the repositories that I've installed and updated to with the Android SDK Manager.

However, when I attempt to add the line:

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

Gradle becomes stuck on addDependecies. Furthermore, when I go to Module Settings, and then to Dependencies, when I try to add a new library, the 'com.android.support:design:22.2.0' does not appear within the list!

Here's additional information about my target, compile, and minimum SDK version:

android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
    applicationId "com.myandroidapplication.newtestapp"
    minSdkVersion 14
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
productFlavors {
}
}

What could I possibly be missing at this point? Thank you!

like image 643
waylonion Avatar asked Jul 31 '15 21:07

waylonion


2 Answers

You have to use version 22.2.1 as it has installed on your computer.

compile 'com.android.support:design:22.2.1'
like image 138
Sharj Avatar answered Nov 07 '22 16:11

Sharj


For me, I was initially adding the support library dependency by typing it out in the build.gradle of my app directly. I cleaned the line that I had typed and added the dependency through the android studio GUI,

  1. Go to File
  2. Choose Project Structure
  3. Click on the Dependencies tab
  4. Click on the + symbol in the upper right conner and choose Library Dependency.
  5. Search for and add the support library in the dialog that appears
  6. Gradle build/sync should start automatically.

Don't know why, but it works for me at least.

like image 43
Prince Odame Avatar answered Nov 07 '22 17:11

Prince Odame