Failed to resolve: com.android.support:support-v4:23.0.0
Asked Answered
O

10

27

After update with the latest Android support library 23.1 i get this error

Failed to resolve: com.android.support:support-v4:23.0.0

I tried all combination of 23.+ and 23.1.0 and 23.1.+ etc. How to make it run properly?

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "ua.g.tfinder"
        minSdkVersion 14
        targetSdkVersion 23
        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:23.0.+'
    compile 'com.android.support:support-v4:23.+'
    compile 'com.android.support:recyclerview-v7:23.0.+'
    compile 'com.android.support:cardview-v7:23.0.+'
    compile 'com.android.support:design:23.0.+'
    compile 'com.google.android.gms:play-services:7.5.+'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
}
Operator answered 17/10, 2015 at 9:40 Comment(1)
After updated the sdk-manager try to clean and rebuild the project.Wayside
S
31

The support libraries are now available through Google's Maven repository.

Step 1: Open the build.gradle file of your project.

Step 2: Make sure that the repositories section includes a maven section with the "https://maven.google.com" url in it.

allprojects {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
    }
}
Steelhead answered 10/8, 2017 at 18:3 Comment(1)
This works perfectly for old version of libraries thanks!Venerate
F
19

I ran into the same problem today. Although the SDK Manager marked a few libraries as installed, investigating the location of the files showed me the correct folder structure, without any files in them.

For example, checking out the location of 23.1.0 appcompat-v7 on my Mac: .../sdk/extras/android/m2repository/com/android/support/appcompat-v7 turned out to be an empty folder.

I suspect the update I ran minutes before went wrong somehow.

What solved it for me:

  1. in Android Studio, open Appearance and Behaviour -> System Settings -> SDK Manager
  2. under tab "SDK Tools" un-check the libraries causing problems
  3. click "apply" to uninstall them
  4. re-check the same libraries
  5. click "apply" to reinstall them
  6. close SDK Manager and run Gradle sync / build
Flavone answered 20/10, 2015 at 11:34 Comment(2)
There is no Android tab under Tools in Android Studio 3.0.1. Please precise your version when submitting this kind of answerMerrie
@EmilKorngold androidSDK is under appearance and behavior > system SettingsGerlachovka
G
14

Had to add "Android Support Repository" from SDK Manager.

Galton answered 16/4, 2016 at 15:53 Comment(0)
D
11

As you already have v7 dependency added in your gradle file no need to add dependency for v4 because it is already included in v7 library.

gradle file should looks like this

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "ua.guru.lvivflatfinder"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    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:23.1.0'
    compile 'com.android.support:recyclerview-v7:23.1.0'
    compile 'com.android.support:cardview-v7:23.1.0'
    compile 'com.google.android.gms:play-services:8.1.0'
}

.......

  1. (build.gradle (MOdule.app)
  2. implementation 'com.android.support:cardview-v7:28.0.0-rc01'
Dysphagia answered 17/10, 2015 at 10:14 Comment(4)
now i get Error:Failed to resolve: com.android.support:support-v4:23.1.0 Install Repository and sync projectOperator
but i already installed latest Android support library 23.1 and support repo 24Operator
please double check it because my app is working fine with these dependencies i.imgur.com/fFErM1h.png?1Dysphagia
In my case just commenting that support library was enough.Antakiya
A
3

In my case, opening SDK manager and installing Local Maven Repository for Support Libraries fixed my issue.

Artemas answered 31/3, 2016 at 13:45 Comment(0)
F
0

Go to File -> Project Structure then select Dependencies tab and remove com.android.support:support-v4:23.0.0

It worked for me

Foreandaft answered 10/4, 2018 at 11:52 Comment(0)
M
0
  1. Gradle sync / build
  2. implementation 'com.android.support:cardview-v7:28.0.0-rc01'

ready and go!

Masson answered 23/8, 2018 at 21:56 Comment(0)
U
0

I got a similar problem, was trying to change versions and so on. Did not work for me. Only after I changed the version and restarted Studio it started to work. Probably gradle doesn't sync that normaly while you don't restart Studio.

Unoccupied answered 3/7, 2019 at 6:3 Comment(0)
M
0

I got this error when I tried to build the app while being OFFLINE. After connecting to the internet it worked :-)

Moravian answered 15/3, 2020 at 2:48 Comment(0)
C
0

he support libraries are now available through Google's Maven repository.

Step 1: Open the build.gradle file of your project and add the following dependencies.

allprojects {
repositories {
    jcenter()
    mavenLocal()
    mavenCentral()
    jcenter()
    google()
}
Catalano answered 2/4, 2021 at 10:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.