Failed to resolve: com.android.support:appcompat-v7:25.1.0

AndroidAndroid Gradle-Plugin

Android Problem Overview


enter image description hereMy Android Studio is full of error android studio cannot identify libraries.

Error:(27, 13) Failed to resolve: com.android.support:appcompat-v7:25.1.0

Android Solutions


Solution 1 - Android

Make sure that the repositories section includes a maven section with the "https://maven.google.com" endpoint. For example:

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

Update:

allprojects {
    repositories {
        google()

        // If you're using a version of Gradle lower than 4.1, you must
        // instead use:
        //
        // maven {
        //     url 'https://maven.google.com'
        // }
    }
}

See android documention for details

Solution 2 - Android

There is a problem with latest libraries to be automatically installed by clicking

> Install Repository and sync project

Go to SDK Manager and install your missing or not up-to-date packages from below tab:

enter image description here

After you select desired library, click Apply and wait for installation to complete.

Solution 3 - Android

Replace whatever build gradle version with this

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

Then Click on

Fix Gradle wrapper and re-import the project

Solution 4 - Android

  1. At first change your buildToolsVersion version 23.0.1 to 25.0.1
  2. Set compileSdkVersion 25

Finally

compileSdkVersion 25
buildToolsVersion "25.0.1"

Make sure you update your support repository . Then Clean-Rebuild-Run.

Solution 5 - Android

add below code in your Project level gradle in allprojects{}

 maven {
        url "https://maven.google.com"
    }

Solution 6 - Android

click the link

> "Install Repository and sync project"

Solution 7 - Android

I had some problems as you say in recently. And I resolve these problem as follow:

Step 1. Create a new android project in AndroidStudio , and it can run normally.

Step 2. Please make sure your project can run normally, and see the build.gradle file, then find the version code in build.gradle file. And my build.gradle file like as follow:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion 24.0.1
}
...
...
dependencies {
    // App's dependencies, including test
    compile "com.android.support:appcompat-v7:23.4.0"
    compile "com.android.support:cardview-v7:23.4.0"
}

And the correct version 23.4.0 is what you want.

If you can not solve the problem, you can change compileSdkVersion and buildToolsVersion.

Step 3. Config the correct version in your build.gradle file and sync project.

Solution 8 - Android

Firstly, you will go (your_folder_app)\app\app.iml, which open your notepad software. After you will find: and you change to 27 with your version, for example for me, i change to 25.

Secondly, you will change the build.gradle(Moudule:app) in your android studio. Red arrow show that you should to change.enter image description here. Example for me:enter image description here

Finally, you will click "Try Again"

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
QuestionRicha SinghView Question on Stackoverflow
Solution 1 - AndroidTomero IndonesiaView Answer on Stackoverflow
Solution 2 - Androiduser4156995View Answer on Stackoverflow
Solution 3 - AndroidSurbhit RaoView Answer on Stackoverflow
Solution 4 - AndroidIntelliJ AmiyaView Answer on Stackoverflow
Solution 5 - Androidsaigopi.meView Answer on Stackoverflow
Solution 6 - AndroidgaomodeView Answer on Stackoverflow
Solution 7 - AndroidEthanView Answer on Stackoverflow
Solution 8 - Androidandreas karkotisView Answer on Stackoverflow