Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to resolve: 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 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?

like image 844
Enryu Avatar asked Jun 22 '17 06:06

Enryu


2 Answers

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" } 
like image 113
Bhavesh Patadiya Avatar answered Sep 21 '22 22:09

Bhavesh Patadiya


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.

like image 45
android developer Avatar answered Sep 21 '22 22:09

android developer