Failed to resolve: com.android.support:cardview-v7:26.0.0 android
Starting from version 26 of support libraries make sure that the repositories
section includes a maven section with the "https://maven.google.com" endpoint.
Something like;
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Failed to resolve: com.android.support:appcompat-v7:26.0.0
To use support libraries starting from version 26.0.0 you need to add Google's Maven repository to your project's build.gradle file as described here: https://developer.android.com/topic/libraries/support-library/setup.html
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
For Android Studio 3.0.0 and above:
allprojects {
repositories {
jcenter()
google()
}
}
Could not resolve com.android.support:appcompat-v7:26.1.0 in Android Studio new project
Finally I fixed the problem by modifying build.gradle
like this:
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
minSdkVersion 16
targetSdkVersion 26
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
}
I've removed these lines as these will produce more errors:
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
Also I had same problem with migrating an existing project from 2.3 to 3.0.1 and with modifying the project gradle files like this, I came up with a working solution:
build.gradle (module app)
android {
compileSdkVersion 27
buildToolsVersion "27.0.1"
defaultConfig {
applicationId "com.mobaleghan.tablighcalendar"
minSdkVersion 16
targetSdkVersion 27
}
dependencies {
implementation 'com.android.support:appcompat-v7:25.1.0'
implementation 'com.android.support:design:25.1.0'
implementation 'com.android.support:preference-v7:25.1.0'
implementation 'com.android.support:recyclerview-v7:25.1.0'
implementation 'com.android.support:support-annotations:25.1.0'
implementation 'com.android.support:support-v4:25.1.0'
implementation 'com.android.support:cardview-v7:25.1.0'
implementation 'com.google.android.apps.dashclock:dashclock-api:2.0.0'
}
Top level build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
Error:(34, 12) Failed to resolve: com.android.support:recycleview-v7:26.0.0-alpha1
In your maven
block:
give space between url
& "https://maven.google.com"
It should look like: url "https://maven.google.com"
Next,
- Go to Android SDK from Android Stuido
- Click
Show Package Details
on bottom right corner - Click Latest version of
Android SDK Build-Tools
,Android SDK Platform-Tools
&Android SDK Tools
(Look at attached screenshot) - Install
Android Support Repository
&Google Repository
if you haven't - replace
compile 'com.android.support:appcompat-v7:26.+'
with compile 'com.android.support:appcompat-v7:26.1.0'
- Replace
compile'com.android.support:design:26.0.0-alpha1'
with compile'com.android.support:design:26.1.0'
- Replace
compile'com.android.support:cardview-v7:26.0.0-alpha1'
with compile'com.android.support:cardview-v7:26.1.0'
- Replace
compile'com.android.support:recycleview-v7:26.0.0'
with compile'com.android.support:recycleview-v7:26.1.0'
Error:(39, 13) Failed to resolve: com.android.support:appcompat-v7:26.0.0
Add this to your project level build.gradle
file:
repositories {
maven {
url "https://maven.google.com"
}
}
Android - Failed to resolve: cardview-v7
I changed it to like bellow and good work:
compileSdkVersion 28
targetSdkVersion 28
And:
implementation 'com.android.support.constraint:constraint-layout:2.0.0-alpha2'
implementation 'com.android.support:exifinterface:28.0.0-rc01'
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.android.support:recyclerview-v7:28.0.0-rc01'
implementation 'com.android.support:cardview-v7:28.0.0-rc01'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.android.support:support-vector-drawable:28.0.0-rc01'
implementation 'com.android.support:multidex:1.0.3'
Failed to resolve: com.android.support:support-v13:26
If your compile SDK version is 26, android support dependencies version should be 26.x.x
Set your gradle dependencies as follow:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
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:26.0.1'
compile 'com.android.support:support-v13:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:26.0.1'
}
If you still get compile errors, add google maven repository to Project Gradle
file:
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
}
Related Topics
Creating a System Overlay Window (Always on Top)
How to Make Links in a Textview Clickable
How to Connect to My Http://Localhost Web Server from Android Emulator
How to Add Dividers and Spaces Between Items in Recyclerview
How to Update Gradle in Android Studio
How to Detect When Wifi Connection Has Been Established in Android
Getting an Issue While Checking the Dynamically Generated Checkbox Through List View
Android Imageview Zoom-In and Zoom-Out
"Failed to Load Ad: 3" With Doubleclick
How to Make My Custom Objects Parcelable
How to Turn on Front Flash Light Programmatically in Android
Viewpager and Fragments - What's the Right Way to Store Fragment'S State
Android Toolbar Center Title and Custom Font
Android: How to Prevent the Soft Keyboard from Pushing My View Up
Custom Listview Adapter With Filter Android
Background Task, Progress Dialog, Orientation Change - Is There Any 100% Working Solution