Failed to resolve: com.android.support.design:25.4.0

AndroidGradleAndroid Gradle-Plugin

Android Problem Overview


I added the following line to my build.gradle(Module:app):

compile 'com.android.support:design:25.4.0' 

But when executing Gradle I'm getting

Failed to resolve: com.android.support.design:25.4.0

I got that the support code from the android support design library and added it to a new project. I added it to the dependency section as such:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:design:25.4.0'
}

Any ideas on what I'm doing wrong?

Android Solutions


Solution 1 - Android

> Important: The support libraries are now available through Google's Maven repository. You do not need to download the support > repository from the SDK Manager. For more information, see Support > Library Setup.

Step 1: Open the build.gradle file for your application.

Step 2: 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"
        }
    }
}

Step 3: Add the support library to the dependencies section. For example, to add the v4 core-utils library, add the following lines:

dependencies {
    ...
    compile "com.android.support:support-core-utils:25.4.0"
}

Solution 2 - Android

A more updated version of the answer of "Bhavesh Patadiya" :

  1. In your project build.gradle file, add google() into the repositories blocks:

     repositories {
         jcenter()
         google()
     }
    
  2. Update the same file with a newer Gradle version:

     classpath 'com.android.tools.build:gradle:2.3.3'
    
  3. If the above cause you new issues or the same issue, exit Android-Studio, and delete the "gradle" folder/s (maybe also ".gradle" folder) and the "build" folder and sub-folders, and then open Android-Studio again.

Solution 3 - Android

Always keep appcompact version and support lib versionssame, so change com.android.support:design:25.4.0 to com.android.support:design:25.3.1

Solution 4 - Android

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

Solution 5 - Android

Mr. Bhavesh Patadiya give us a good solution. However, I'd like to share something more, to make fix process more explicit.

There are two "build.gradle" files under the project directory. Their pathes are to be "Your-project-root-dir/build.gradle" and "Your-project-root-dir/app/build.gradle" respectively. When you see the error information in your android studio, and try to trace the file, you will probably open the second one.

You should add this statement in the first file ("Your-project-root-dir/build.gradle").

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

and add the statements in the second build.gradle ("Your-project-root-dir/app/build.gradle")

dependencies {
    ...
    compile "com.android.support:support-core-utils:27.0.2"
}

Solution 6 - Android

You need to update the android support Repository in the SDK manager . Also the Design Library depends on the Support v4 and AppCompat Support Libraries.

Same version android support must be the same with others..

compile 'com.android.support:appcompat-v7:25.3.1'  <-- same
compile 'com.android.support:design:23.3.1'  <-- same

Solution 7 - Android

after adding :

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

make sure your Gradle sync is on ONLINE mode you can check it from:

> Android studio -> Preferences -> Build, Execution, Deployment -> > Gradle -> Offline work (make sure this check box is not selected)

Solution 8 - Android

This problem occurs when there is andoridtestImplementation is added in app.build.

Remove testImplementation,androidTestImplementation from the app.build, that solves this issue.

Solution 9 - Android

Above answers did't resolve anything for me.

  • Tried syncing the project- Failed.
  • Tried building the project -Failed

Problem found :

> Sdk Support Repository was corrupted

.

Fix:

> Go to the SDK manager, click the "SDK Tools" tab. If the check-mark > for "Support Repository" is selected, unselect it and click OK. This > will delete all of the files in the repository. Then recheck the > check-mark, click GO and reinstall the repository.

Solution 10 - Android

If you still have the issue, check the project settings for offline mode. if offline mode is on, then off and sync the project. That fixed my issue.

Solution 11 - Android

There is no library by that name. There is com.android.support:recyclerview-v7:25.4.0.

Failed to resolve com.android.support:support-compat:25.4.0
Failed to resolve com.android.support:support-core-ui:25.4.0

I am trying to include this library to my project by adding

compile 'jp.wasabeef:recyclerview-animators:2.2.7'

so remove this line from gradle
my error just resolved

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
QuestionEnryuView Question on Stackoverflow
Solution 1 - AndroidBhavesh PatadiyaView Answer on Stackoverflow
Solution 2 - Androidandroid developerView Answer on Stackoverflow
Solution 3 - AndroidPravin SutharView Answer on Stackoverflow
Solution 4 - AndroidGurgen HakobyanView Answer on Stackoverflow
Solution 5 - AndroidEric AndrewsView Answer on Stackoverflow
Solution 6 - AndroidZeroOneView Answer on Stackoverflow
Solution 7 - AndroidSina MirshafieiView Answer on Stackoverflow
Solution 8 - AndroidGowthamanView Answer on Stackoverflow
Solution 9 - AndroidopalfireView Answer on Stackoverflow
Solution 10 - Androiduser2486322View Answer on Stackoverflow
Solution 11 - AndroidMakvinView Answer on Stackoverflow