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

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

  • Can't handle both click and touch events simultaneously
  • SearchView hints not showing for single character typed
  • Compass in Android
  • Broadcast receiver not working in ICS if the app is not started atleast once
  • Throwable: Failed to create the SD card
  • Get position of imageview on layout android
  • 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.

  • null keyevent and actionid = 0 in onEditorAction() (Jelly Bean / Nexus 7)
  • remove rule from RelativeLayout before api 17
  • How to attach source to android.jar
  • How can I deliver parameters to a test function, that launched using adb shell am Instrumentation command
  • Weird MapView problem; PixelConverter Error
  • renaming the name of the APP alone in Android Eclipse IDE
  • 5 Solutions collect form web for “Android Studio: Failed to find: 'com.android.support:support-v4:19.1.0'”

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

    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.

    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.

    In my case the solution was as simple as running Build:Make Project. No amount of gradle syncing or clearing caches would do it. Of course, that required getting my project into a state where it would build successfully.

    Following the instruction here helped me. For whatever reason when I had to reinstall the latest version of android studio the initial download of the extras section android support library failed. I simply retried it. Followed the steps mentioned and verified it was added to the build.gradle file and did a rebuild project and good to go.

    http://developer.android.com/tools/support-library/setup.html

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.