Could not find: com.android.support:support-v4:22.2.0

I am trying to make an application, but there seems to be some error with gradle files. It worked fine until I updated the support libraries. I worked with api 21, which worked fine, but then I upgraded to api22 and modified the gradle files accordingly. Now this error appears.

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 greatly appreciated.

+6
source share
2 answers

If this can help someone, after many trials and errors, I found that I was targeting the wrong version of the SDK (older) in the build.gradle file corresponding to the "library". To change this, you can do it manually or go to the module settings menu (right-click on the project folder → “Open module parameters.” Then in “library” - “Properties” you can change “Compile Sdk” and “Tool versions assembly "

enter image description here

+1
source

Using the Android SDK Manager. Go to Extras and then Android Support Repository and upgrade it to the latest version.

(This is essentially a @natario comment, but that should be the answer.)

0
source

Source: https://habr.com/ru/post/989855/


All Articles