Android Studio: Failed to find: 'com.android.support:support-v4:19.1.0'

42,616

Solution 1

Ok, found the problem. The Android support repository was missing. After installing and restarting Android Studio it worked.

Solution 2

If you are using Android Studio, then as an addition to changing the build.gradle file manually, you can also lookup the dependency via the library dependencies under the Project Structure menu item.

Find where com.android.support is

Double clicking that dependency will generate this line in build.gradle:

dependencies {
    compile 'com.android.support:support-v13:+'
}

And also, if you are wondering what this library is about, it's described at the developer pages at developer.android.com; Support Library.

Solution 3

My Android Studio version is 1.1. I select tools->Android->SDK Manager, check the Android Support Library then click Install packages, solved this issue.

Share:
42,616
MrHill
Author by

MrHill

Updated on December 13, 2020

Comments

  • MrHill
    MrHill over 3 years

    I want to build an app in Android Studio with the support library but I get the following error when adding the dependency for the support library:

    Error:Failed to find: com.android.support:support-v4:19.1.0
    

    Here is my build.gradle file

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 19
        buildToolsVersion '20'
    
        defaultConfig {
            applicationId "sample.myapplication"
            minSdkVersion 15
            targetSdkVersion 19
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
    
            release {
                runProguard false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:support-v4:19.1.0'
    
    }
    

    I have downloaded the support library via the sdk manager.