0

I suddenly get this error and I don't know how to resolve this. I already tried all suggestions here Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve but nothing worked for me. I already updated my sourceCompatibility and targetCompatibility from 1.7 to JavaVersion.VERSION_1_8 as it was suggested to me.

ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.google.android.gms:play-services-measurement-base:[17.2.0].
Show Details
Affected Modules: app

ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.google.android.gms:play-services-measurement-impl:[17.2.0].
Show Details
Affected Modules: app

ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-gass:[18.2.0].
Show Details
Affected Modules: app


...

Here is my build.gradle (Project):

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.firebase.firebase-perf'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.example.android.guessit"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.google.android.material:material:1.1.0-alpha10'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'com.google.android.gms:play-services-auth:17.0.0'

    //Firebase SDKs
    implementation 'com.google.firebase:firebase-core:17.2.0'
    implementation 'com.google.firebase:firebase-auth:19.1.0'
    implementation 'com.google.firebase:firebase-analytics:17.2.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
    implementation 'com.google.firebase:firebase-ads:18.2.0'
    implementation 'com.google.firebase:firebase-perf:19.0.0'
    implementation 'com.google.firebase:firebase-messaging:20.0.0'

    implementation "androidx.lifecycle:lifecycle-extensions:2.1.0"

    //Glide maybe later add code to proguard
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'

    // Circle ImageView
    implementation 'de.hdodenhof:circleimageview:3.0.1'

    // CardView and GridLayout
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.gridlayout:gridlayout:1.0.0'

    // Facebook SDK and login
    implementation 'com.facebook.android:facebook-login:4.41.0'

    //image downloading and caching library for Android
    implementation 'com.squareup.picasso:picasso:2.71828'
}

apply plugin: 'com.google.gms.google-services'   // Google Play services Gradle plugin


Also in the SDK manager the SDK 29 is displayed as partially installed although there is nothing else I can Install for this SDK.

Edit:

This topic has been resolved. I restarted my computer and it worked again. I think the problem was that under SDK sites there was an error displayed so there was no connection to the download site. Probably also because my internet security program Kaspersky which wasn't running right, but after restarting the computer it was working fine again.

Daniel Spatz
  • 77
  • 1
  • 14
  • 1
    update all libraries to latest version – Amin Pinjari Oct 07 '19 at 07:46
  • When I update the google services from 4.3.1 to 4.3.2 I get this error: Could not resolve all artifacts for configuration ':classpath'. > Could not resolve com.google.gms:google-services:4.3.2. – Daniel Spatz Oct 07 '19 at 07:58

2 Answers2

1

Something similar happened to me recently,

  1. delete the .idea folder from the project directory
  2. Remove the .iml file
  3. Invalidate catches and restart
Trajox
  • 352
  • 3
  • 11
1

enter image description hereGo to SDK Manager -> SDK Tools -> Install "Google Play Services"

Dashesh
  • 308
  • 3
  • 11
  • There is nothing to update, its all up to date – Daniel Spatz Oct 07 '19 at 07:59
  • 1
    Please recheck your SDK manager, added screenshot for reference. – Dashesh Oct 07 '19 at 08:29
  • As stated before I installed the Google Play services SDK + Google Play licensing Library + Google Play APK Expansion Library – Daniel Spatz Oct 07 '19 at 08:36
  • Also when I click on " SDK update sites" there is an error displayed in the "Android Repository" it says "IO exception while downloading manifest" – Daniel Spatz Oct 07 '19 at 10:02
  • 1
    I just restarted my computer and it is now working as expected. Also the "IO exception" under the SDK updates sites is not displaying anymore. I think the problem was that this caused all the errors as seen in my post. I also changed the HTTP Proxy under the System Settings to "Auto-detect proxy settings" – Daniel Spatz Oct 08 '19 at 07:18