Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to find: com.android.support:support-v4:22.2.0

I am trying to do an application but there seems to be some error with the gradle files now. It was working fine until I upgraded the support libraries. I was working with api 21 which worked fine, but then i upgraded to api22 and changed the gradle files accordingly.. Now this error shows up.

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

This is my current gradle file :

apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "com.example.sampleapp"
    minSdkVersion 12
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.jakewharton:butterknife:6.1.0'
}

Any help would be appreciated.

like image 621
jincy abraham Avatar asked Jun 27 '15 12:06

jincy abraham


1 Answers

If this might help someone, after MANY trials and errors, I found that I was targeting the wrong SDK version (an older one) in the build.gradle file corresponding to "library". To change this you can do it by hand or go to the Module Settings Menu (right click on your project folder -> Open Module Settings. Then in "library" - Properties you can change the Compile Sdk and the Build Tools Versions

enter image description here

like image 114
Carlos Borau Avatar answered Nov 12 '22 03:11

Carlos Borau