My system suddenly went off and I switched it on and I got Error:Failed to resolve: android.arch.core:common:1.1.0 error in my android studio. I have tried clean and rebuild project but it did not work. I have researched on the internet but none could solve my problem.
build. gradle(project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://jitpack.io'
}
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle(App)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.1"
defaultConfig {
applicationId "com.example.system2.tranxav"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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.stripe:stripe-android:6.1.1'
compile 'com.stripe:stripe-java:1.47.0'
compile 'com.stripe:stripe-android:1.0.4'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.volley:volley:1.0.0' // dependency file for Volley
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support:cardview-v7:27.1.0'
compile 'com.android.support:recyclerview-v7:27.1.0'
compile 'com.android.support:design:27.1.0'
compile 'com.basgeekball:awesome-validation:1.3'
compile 'com.parse:parse-android:1.16.5'
compile 'com.parse.bolts:bolts-tasks:1.4.0'
compile 'com.parse.bolts:bolts-applinks:1.4.0'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-appindexing:8.4.0'
}
I don't know what could be the cause of the problem.
I resolve this issue by moving
maven {url "https://maven.google.com"}
beforejcenter()
, like this:This is because I find
jcenter()
repository has deleted the directory of android.arch.core, so we have to get this file (android.arch.core:common-1.1.0.jar
) from"https://maven.google.com"
Solution: move
google()
, beforejcenter()
- it worked for me.But the issue is that you have two
build.gradle
files and you need to make a change in both.Issue
In the past few weeks some Google Android libraries on jcenter have gone missing, causing errors like yours.
Example:
jcenter's
maven-metadata.xml
is still valid and contains versions which is causing gradle to assume the listed files are there and will try to download them without falling back tohttps://maven.google.com/
. Even if you have this orgoogle()
next in yourbuild.gradle
, underjcenter()
.Fix
In your root
build.gradle
make suregoogle()
is beforejcenter()
.In most projects you will have to update this in 2 spots.
Note: Use
maven { url "https://maven.google.com" }
instead ofgoogle()
if your Gradle version is less than 4.0.kindly check proxy details also because some time library not pull due to proxy error kindly check gradel.property file