Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:Failed to resolve: android.arch.core:common:1.1.0

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.

like image 533
shabz4real Avatar asked Apr 15 '18 07:04

shabz4real


4 Answers

I resolve this issue by moving maven {url "https://maven.google.com"} before jcenter(), like this:

repositories {
    maven { url "https://maven.google.com" }
    jcenter()
    maven { url 'https://jitpack.io' }
}

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"

like image 160
sanwuwy Avatar answered Nov 17 '22 20:11

sanwuwy


Issue

In the past few weeks some Google Android libraries on jcenter have gone missing, causing errors like yours.

Example:

Could not resolve all files for configuration ':app:debugCompileClasspath'.
Could not find common.jar (android.arch.core:common:1.1.0). Searched in the following locations:
      https://jcenter.bintray.com/android/arch/core/common/1.1.0/common-1.1.0.jar

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 to https://maven.google.com/. Even if you have this or google() next in your build.gradle, under jcenter().

Fix

In your root build.gradle make sure google() is before jcenter().

repositories {
    google()
    jcenter()
}

In most projects you will have to update this in 2 spots.

buildscript {
    repositories {
        google()
        jcenter()
    }

}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

Note: Use maven { url "https://maven.google.com" } instead of google() if your Gradle version is less than 4.0.

like image 29
jkasten Avatar answered Nov 17 '22 21:11

jkasten


Solution: move google(), before jcenter() - it worked for me.

But the issue is that you have two build.gradle files and you need to make a change in both.

like image 10
Gaden Avatar answered Nov 17 '22 21:11

Gaden


kindly check proxy details also because some time library not pull due to proxy error kindly check gradel.property file

like image 1
rakesh rajput Avatar answered Nov 17 '22 22:11

rakesh rajput