Android Studio could not find any version that matches com.android.support:appcompat-v7:+

AndroidAndroid Studio

Android Problem Overview


Running a project in Android Studio fails with this error: could not find any version that matches com.android.support:appcompat-v7:+

How can I fix this error?

Android Solutions


Solution 1 - Android

From Android Studio go to: Tools >> Android >> SDK Manager

Select and install "Extras|Android Support Repository"

Solution 2 - Android

For me it worked after changing the version from 7:27.+ to 7:+

Solution 3 - Android

In Project > app > build.gradle file replace the line

implementation 'com.android.support:appcompat-v7:+'29.+'

with

implementation 'com.android.support:appcompat-v7:+'

and line

implementation 'com.android.support:design:29.+'

with

implementation 'com.android.support:design:+'

Then clean build

Solution 4 - Android

Also as as said on https://stackoverflow.com/questions/10712812/how-to-update-android-platform-tools-in-a-headless-linux

 android list sdk

 android update sdk --no-ui --filter extra

Solution 5 - Android

It is very simple. Kindly update and replace the below code in build.gradle(Project :App Name).

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

Solution 6 - Android

After installing Extras|Android Support Repository, It does not work for me. Then I change v7:1.6 to v7:1.8 in the app build.gradle file.

com.android.support:appcompat-v7:1.8.+! and It works for me.

Solution 7 - Android

Open SDK Manager.exe in your Android Studio folder and install a matching API.

Solution 8 - Android

I found all these answers incorrect for me. Instead in your android studio look below on the left. There will be some help for this.

For example, you will notice This support library should not use a different version (32) than the compilesdkVersion (23)

Then you change the version of to 23 like this >compile 'com.android.support:support-v4:23'

Now, you will see a message A newer version of com.android.support-v4 than 23 is available 23.4.0.

Thats how I knew that the correct version is 23.4.0

Solution 9 - Android

If you see this after you've just created a new project in Intellij then try to recreate it again with "Use AndroidX artifacts" checked

Solution 10 - Android

To whom came here for same error but version 29, change your support library to version 28:

build.gradle(app):

dependencies {
    ...
    implementation 'com.android.support:appcompat-v7:28.+'
    ...
}

None of googled solutions worked for me. Then I saw Android has only support library up to version 28. It is weird that I got this error in an out-of-box created Android Studio project.

I'm not sure which Android Studio version was, cause I upgraded Studio after got error. Now in Android Studio 3.6.3, new projects coming with 'androidx.appcompat:appcompat:1.0.2'.

Solution 11 - Android

This worked for me to build and run this project. I had to add google in both sections.

build.gradle (project)

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}

build.gradle(app)

apply plugin: 'com.android.application'



android {
    compileSdkVersion 26
    buildToolsVersion "29.0.2" //25.0.2"
    defaultConfig {
        applicationId 'com.github.nkzawa.socketio.androidchat'
        minSdkVersion 17
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    ////noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:25.0.+'
    ////noinspection GradleCompatible
    implementation 'com.android.support:recyclerview-v7:25.0.+'
    implementation ('io.socket:socket.io-client:0.8.3') {
        exclude group: 'org.json', module: 'json'
    }

    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    testImplementation 'junit:junit:4.12'
}

Solution 12 - Android

Got the same error but version 26.

Downloading the libraries through the SDK Manager is no longer supported. The support libraries are now available through Google's Maven repository.

Solution:

In build.gradle (project) inside both buildscript/repositories and allprojects/repositories add this:

maven {
            url 'https://maven.google.com/'
            name 'Google'
        }

Result:

buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

It worked for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionArdaZeytinView Question on Stackoverflow
Solution 1 - AndroidJames EdgarView Answer on Stackoverflow
Solution 2 - Androidosama yaccoubView Answer on Stackoverflow
Solution 3 - AndroidPetronellaView Answer on Stackoverflow
Solution 4 - AndroidPaul VerestView Answer on Stackoverflow
Solution 5 - AndroidAnanta PrasadView Answer on Stackoverflow
Solution 6 - AndroidcbyniiaiiView Answer on Stackoverflow
Solution 7 - AndroidZulakisView Answer on Stackoverflow
Solution 8 - AndroidSiddharthView Answer on Stackoverflow
Solution 9 - AndroidITishaView Answer on Stackoverflow
Solution 10 - AndroidKuvalyaView Answer on Stackoverflow
Solution 11 - AndroidMPVView Answer on Stackoverflow
Solution 12 - AndroidsimoJoudarView Answer on Stackoverflow