Failed to solve: com.android.support:cardview-v7:26.0.0 android

I am trying to add recyclerview to my project and get this error, and I added it from Android studio dependencies this error appears when trying to add recyclerview to android studio

this is a compiled version ...

+67
android android-gradle android-recyclerview android-support-library
Jul 14 '17 at 12:39 on
source share
19 answers

Starting with version 26 of the support libraries, make sure the repositories section contains the maven section with the endpoint https://maven.google.com .

Something like:

 allprojects { repositories { jcenter() maven { url "https://maven.google.com" } } } 
+180
Jul 27 '17 at 5:54 on
source share

This is how I work.

  • Add maven { url "https://maven.google.com" } as @Gabriele_Mariotti suggests.

     allprojects { repositories { jcenter() maven { url "https://maven.google.com" } } } 
  • Then in the build.gradle file inside the App folder add

     compileSdkVersion 26 buildToolsVersion "25.0.3" defaultConfig { applicationId "com.xxx.yyy" minSdkVersion 16 targetSdkVersion 26 } 
  • Then on dependencies use

     dependencies { compile 'com.android.support:appcompat-v7:26.0.1' compile 'com.android.support:design:26.0.1' compile 'com.google.android.gms:play-services-maps:11.0.4' compile 'com.google.android.gms:play-services-location:11.0.4' compile 'com.mcxiaoke.volley:library-aar:1.0.0' compile 'com.android.support:cardview-v7:26.0.1' } 
+18
Aug 16 '17 at 6:02
source share

Just add this to your main project.general build.gradle file under allprojects ()

  maven { url "https://maven.google.com" } 
+10
04 Oct '17 at 6:21
source share

I am facing the same problem while updating the SDK and Android version (3.0 beta). I solved this problem by going through this tutorial. In this they said that we are updating the assembly configuration file, for example

 android { compileSdkVersion 26 buildToolsVersion '26.0.0' defaultConfig { targetSdkVersion 26 } ... } dependencies { compile 'com.android.support:appcompat-v7:26.0.0' } // REQUIRED: Google new Maven repo is required for the latest // support library that is compatible with Android 8.0 repositories { maven { url 'https://maven.google.com' // Alternative URL is 'https://dl.google.com/dl/android/maven2/' } } 

Hope this helps you.

+9
Aug 23 '17 at 11:14
source share

in the case when I found that OneSignal changed its dependencies

so i changed it with

compile 'com.onesignal:OneSignal:[3.5.8, 3.99.99]'

to

compile 'com.onesignal:OneSignal:[3.5.8, 3.5.8]'

then it works, please check for any non-specific dependency.

+4
Aug 14 '17 at 13:28
source share

Add this to the build.gradle file at the project level and it should work fine.

 allprojects { repositories { google() // this is to be added if there something already. jcenter() } } 
+4
Aug 16 '17 at 17:43 on
source share

Google’s new Maven registry is required for the latest support library compatible with Android 8.0. Just update the Google Maven repository as shown below:

To add them to your assembly, add maven.google.com to the Maven repository in your module level build.gradle file:

 repositories { maven { url 'https://maven.google.com' // Alternative URL is 'https://dl.google.com/dl/android/maven2/' } } 

Alternatively, you can update the build.gradle file as follows:

  repositories { jcenter() google() } 

Then add the desired library to the dependency block. For example, a map library looks like this:

 dependencies { compile 'com.android.support:cardview-v7:26.1.0' } 
+3
Sep 24 '17 at 7:48
source share

try to compile

  compile 'com.android.support:cardview-v7:25.3.1' 
+2
Jul 14 '17 at 12:41
source share

Update your Android support repository from sdk manager.

+2
Jul 14 '17 at 12:44
source share

There is another way to add google repository

  • Add gradle-4.1-rc-1-all to gradle -wrapper.properties.

     distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip 
  • Then add google() to the top level build.gradle file

     allprojects { repositories { google() jcenter() } } 
+2
Aug 25 '17 at 5:42 on
source share

If you are using Android Studio 3.0 or higher , make sure your build.gradle project should have content similar to -

 buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' } } allprojects { repositories { google() jcenter() } } 

And for below Android Studio 3.0 and starting with support libraries 26. + your build.gradle project should look like this: p>

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

check these links below for more details -

1 - Creating Android Applications

2 - Add build dependencies

3 - Customize your build

+2
Jan 13 '18 at 20:10
source share

Clear gradle from terminal

 ./gradlew clean 

then use this code in build.gradle section

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

Make sure your version of the library is available. For your verification you can use the link

+1
Sep 19 '17 at 7:50
source share

Just change the build version with msgstr "

to

compile 'com.android.support:appcompat-v7:26.0.0-alpha1'

This will solve your problem.

+1
Sep 19 '17 at 13:34 on
source share

Use compile 'com.android.support:cardview-v7:25.4.0'
If you need version 26, you should use compile 'com.android.support:cardview-v7:26.0.0-beta2' , because now it's beta

0
Jul 14 '17 at 1:01 on
source share
 android { compileSdkVersion 26 buildToolsVersion '26.0.2' useLibrary 'org.apache.http.legacy' defaultConfig { applicationId "com.test" minSdkVersion 15 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" multiDexEnabled true } 

it works for me

0
Nov 30 '17 at 10:05
source share

If other solutions do not work here, make sure that you are not offline . If enabled, android will not download the necessary files, and you will get this error.

enter image description here

0
Jan 04 '18 at 19:01
source share
 compile 'com.android.support:cardview-v7:+' 

This should print the latest version and allow its compilation.

0
Jan 26 '18 at 1:51
source share

try it,

goto Android-> sdk make sure you have all the dependencies. if not, download them. then goto File -> Settigs -> Build, Execution, Depoyment -> Gradle

choose to use the default gradient wapper (recommended)

and untick offline work

gradle build succeeds as soon as you can change the settings

0
Mar 02 '18 at
source share

Perhaps this problem is related to the facebook library. Replace

 compile 'com.facebook.android:facebook-android-sdk:[4,5)' 

 compile 'com.facebook.android:facebook-android-sdk:4.26.0' 
0
Mar 29 '18 at 10:53
source share



All Articles