0

It happens when opening projects or with open projects, I don't know if Android Studio may have been corrupted or it could be some permission issue.

All the projects have suddenly stopped working and it indicates the following error:

> Could not resolve android.arch.lifecycle:livedata:1.1.1.
 Required by:
  project :app > com.android.support:loader:28.0.0
> Could not resolve android.arch.lifecycle:livedata:1.1.1.
  > Could not get resource 
'https://dl.google.com/dl/android/maven2/android/arch/lifecycle/livedata/1.1.1/livedata-1.1.1.pom'.
     > Failed to move file '/private/var/folders/yl/rjxf9qcx2rdfztl5mh93q_rm0000gn/T/gradle_download32524353575854917bin' into filestore at 'android.arch.lifecycle/livedata/1.1.1/b4b4d001ca961adb29783cfcdb61c36f877c51bf/livedata-1.1.1.pom' 
        > Failed to create parent directory '/Users/myuser/.gradle/caches/modules-2/files-2.1/android.arch.lifecycle/livedata' when creating directory '/Users/myuser/.gradle/caches/modules-2/files-2.1/android.arch.lifecycle/livedata/1.1.1/b4b4d001ca961adb29783cfcdb61c36f877c51bf'

I have it installed in a MAC and I do not have this dependency explicitly in my project.

  apply plugin: 'com.android.application'
  apply plugin: 'io.fabric'
  android {
compileSdkVersion 28
defaultConfig {
    applicationId 'com.example.myproject'
    minSdkVersion 21
    targetSdkVersion 28
    versionCode 23
    versionName "2.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
dataBinding {
    enabled = true
}
productFlavors {
}
}
def gsonVersion = "2.8.0"
def butterKnifeVersion = "8.8.1"
def retrofitVersion = "2.3.0"
def supportVersion = "28.0.0"
def okHttpVersion = "3.7.0"
def loggingInterceptorVersion = "3.8.0"
def circleImageViewVersion = "2.1.0"
def googleServiceVersion = "17.3.4"


 dependencies {
 implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "com.android.support:appcompat-v7:$supportVersion"
implementation "com.android.support:design:$supportVersion"
implementation "com.android.support:support-v4:$supportVersion"
implementation 'com.android.support.constraint:constraint-layout:1.0.2'

implementation "com.google.firebase:firebase-messaging:$googleServiceVersion"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation "com.jakewharton:butterknife:$butterKnifeVersion"
annotationProcessor "com.jakewharton:butterknife-compiler:$butterKnifeVersion"
implementation 'com.github.ViksaaSkool:AwesomeSplash:v1.0.0'
implementation "com.android.support:cardview-v7:$supportVersion"
implementation "com.google.code.gson:gson:$gsonVersion"
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
implementation "com.squareup.okhttp3:okhttp:$okHttpVersion"
implementation "com.squareup.okhttp3:logging-interceptor:$loggingInterceptorVersion"
implementation "de.hdodenhof:circleimageview:$circleImageViewVersion"
implementation('io.socket:socket.io-client:1.0.0') {

    exclude group: 'org.json', module: 'json'
}

implementation 'com.heinrichreimersoftware:material-intro:1.6'
dependencies {
    implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
}

implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'



implementation 'com.facebook.shimmer:shimmer:0.4.0'

implementation 'com.github.MAXDeliveryNG:slideview:1.1.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'

}

apply plugin: 'com.google.gms.google-services'

And app gradle

buildscript {

repositories {
    google()
    jcenter()
    maven {
        url 'https://maven.fabric.io/public'
    }
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.3.1'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    classpath 'com.google.gms:google-services:4.2.0'

    classpath 'io.fabric.tools:gradle:1.28.1'
  }
}

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

task clean(type: Delete) {
  delete rootProject.buildDir
}

I have tried updating to the latest version of gradle and updating libraries, but it failed.

UPDATE:

I have tried giving AndroidStudio full disk access and it doesn't work.

ja12
  • 351
  • 2
  • 16
  • Yes, I experience similar issue. In my case, the error is with retrofit library `ERROR: Failed to resolve: retrofit-2.8.1`. help resolve this – Rahul Bali Mar 26 '20 at 13:13

1 Answers1

0

My problem was that the .gradle 19.26.53 library had been corrupted and I solved it by completely removing Android Studio, with the commands in this post:

How to completely uninstall Android Studio on Mac?

ja12
  • 351
  • 2
  • 16