Hi DW, I've faced an issue with my project, it has been working these years till I think last year or the other year. When I sync it fails saying unable to resolve dependency no matter which version I try I get similar error differs with version number.

Keep in mind I can't replicate your issue since I have no code or your dev system. All I know is that when this happens to me most of the time it clears up when I do a "make clean" or full recompile.

Also, I would have to guess or Google what FCM is. My tip is when you use an acronym try to expand it at least one time in the conversation. Example: That's TSFM! (Too Spooky For Me.)

Have a fun Halloween as you hunt down this ghost.

Hi thanks, I mean FCM as (Firebase Cloud Messaging) this is used for Push notifications. What I think is happening is that I think Google had updated their library or something, because no matter which version I try it keep failing to resolve. I've read Cthis which says theres a library deprecation, but the problem is that no matter which update I try, it keep on failing.

Here's my Gradle:

apply plugin: 'com.android.application'
//apply plugin: 'com.google.gms.google-services'
//apply plugin: 'com.google.gms.google-services'


android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.myuse.myapp"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.squareup.okhttp3:okhttp:3.11.0'
    implementation 'com.android.support:design:28.0.0'
    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.google.firebase:firebase-core:16.0.5'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    //implementation(platform("com.google.firebase:firebase-bom:32.2.0"))
    //implementation 'com.google.firebase:firebase-core:7.2.0'
    //implementation 'com.google.firebase:firebase-messaging:4.3.10'
      //implementation 'com.google.firebase:firebase-messaging:15.0.0'
    //implementation 'com.google.firebase:firebase-messaging:32.1.1'
}

Here's the error:

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.google.firebase:firebase-iid:[17.0.4].
Open File
Show Details


Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.google.firebase:firebase-iid:[17.0.4].
Open File
Show Details


Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.google.firebase:firebase-iid:[17.0.4].
Open File
Show Details


Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.google.firebase:firebase-iid:[17.0.4].
Open File
Show Details


Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.google.firebase:firebase-iid:[17.0.4].
Open File
Show Details

Head back to FCM and compile their demo or in software speak, a minimum viable example.

If their demo or minimum viable example fails, file a bug report.

It sounds like your project’s dependency management might have run into some version conflicts or outdated references. Have you tried clearing the cache or updating your build tools to the latest version? Sometimes resetting the environment or specifying exact versions for dependencies can help resolve such issues.

commented: Thanks I will try and see +8

Hello: You seem to be addressing a difficult problem. Sometimes resolution of dependency might be challenging. Verify that your Gradle files are current and look for any versions' discrepancies. Also sometimes deleting the cache and restarting Android Studio works. Keep cheerful.

You might want to try updating your google-services and firebase dependencies, as there could be some version mismatches causing the issue. Another thing that worked for me in a similar situation was invalidating caches in Android Studio and restarting it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.