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

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

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

But when doing Gradle, I get

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

I got the support code from the android design library support 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?

+60
android android-gradle gradle
Jun 22 '17 at 6:35
source share
11 answers

Important: Support libraries are now available through the Google Maven repository. You do not need to download storage support from the SDK manager. For more information, see Support Configuring the Library .

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

Step 2: Make sure the repository section includes the maven section with the endpoint https://maven.google.com , For example:

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

Step 3: Add the support library to the dependency 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" } 
+179
Jun 22 '17 at 6:38
source share

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

  • In the build.gradle file of the project, add google() to the repositories blocks:

     repositories { jcenter() google() } 
  • Update the same file with the new version of Gradle:

     classpath 'com.android.tools.build:gradle:2.3.3' 
  • If the above causes cause new problems or the same problem, exit Android-Studio and delete the β€œgradle” folder (possibly also β€œ.gradle”) and the β€œbuild” folder and subfolders, and then open Android-Studio again.

+19
Jun 22 '17 at 17:40
source share
 allprojects { repositories { google() jcenter() mavenCentral() } } 
+5
Jun 29 '17 at 11:59 on
source share

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

+4
Jun 22 '17 at 6:38
source share

Mr. Bhaves Patadia gives us a good solution. However, I would like to share something more to make the repair process more explicit.

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

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

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

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

 dependencies { ... compile "com.android.support:support-core-utils:27.0.2" } 
+4
Dec 22 '17 at 12:47 on
source share

You need to update the Android support repository in the SDK manager. In addition, the Design Library is dependent on the support libraries v4 and AppCompat.

Support for the same version of android should be the same with others.

 compile 'com.android.support:appcompat-v7:25.3.1' <-- same compile 'com.android.support:design:23.3.1' <-- same 
+1
Jun 22 '17 at 6:39 on
source share

This problem occurs when andoridtestImplementation is added to andoridtestImplementation .

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

0
Jan 01 '18 at 7:45
source share

The above answers didn't solve anything for me.

  • An attempt to synchronize project- failed .
  • Tried to build a project - Failed

Problem Found:

Sdk Support Repository has been corrupted

,

Fix:

Go to the SDK manager, go to the "SDK Tools" tab. If the "Support Repository" box is checked, clear it and click "OK." This will delete all files in the vault. Then check the checkbox again, press GO and reinstall the repository.

0
Aug 24 '18 at 12:08
source share

If the problem persists, check the project settings offline. If offline mode is on, turn off and sync the project. This fixed my problem.

0
Mar 21 '19 at 4:49
source share

after adding:

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

make sure your Gradle sync is online, you can check this from:

Android Studio β†’ Settings β†’ Build, Run, Deploy β†’ Gradle β†’ Offline Work (make sure this box is not checked)

0
Jul 15 '19 at 13:53 on
source share
 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 
-one
Sep 18 '17 at 7:48 on
source share



All Articles