0

I am trying to add firebase cloud messaging dependency to Gradle.build file and it showing an error. Even though I try to add the latest version (20.0.0), still it shows an error. Please help me with my problem.

I have changed the versions to the latest version of firebase cloud messaging as well as all other dependencies in gradle.build file.

repositories {
maven { url "https://jitpack.io" }

}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-messaging:20.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.android.support:design:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.firebase:firebase-client-android:2.5.2'
implementation 'com.google.gms:google-services:3.1.1'
implementation 'com.firebaseui:firebase-ui-database:4.1.0'
implementation 'org.jetbrains:annotations-java5:15.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.github.clans:fab:1.6.4'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'org.apache.commons:commons-lang3:3.6'
}

The error showing is shown below:

ERROR: In the project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[15.0.

1]", but isn't being resolved to that version. The behavior exhibited by the library will be unknown.

Dependency failing: com.google.android.gms:play-services-flags:15.0.1 -> com.google.android.gms:play-services-basement@[ 15.0.1], but play-services-basement version was 17.0.0.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art ifact with the issue. -- Project 'app' depends onto com.google.firebase:[email protected] -- Project 'app' depends onto com.google.firebase:firebase-auth-interop@{strictly 16.0.0} -- Project 'app' depends onto com.google.firebase:firebase-storage-common@{strictly 16.0.1} -- Project 'app' depends onto com.google.firebase:firebase-database-collection@{strictly 15.0.1} -- Project 'app' depends onto com.google.firebase:[email protected] -- Project 'app' depends onto com.google.firebase:firebase-measurement-connector-impl@{strictly 17.0.1} -- Project 'app' depends onto com.google.firebase:firebase-storage@{strictly 16.0.1} -- Project 'app' depends onto com.google.android.gms:play-services-measurement-api@{strictly 16.0.1} -- Project 'app' depends onto com.google.firebase:[email protected] -- Project 'app' depends onto com.firebaseui:[email protected] -- Project 'app' depends onto com.google.android.gms:play-services-ads-identifier@{strictly 15.0.1} -- Project 'app' depends onto com.google.firebase:firebase-messaging@{strictly 20.0.0} -- Project 'app' depends onto com.google.android.gms:play-services-base@{strictly 17.0.0} -- Project 'app' depends onto com.google.firebase:firebase-analytics-impl@{strictly 16.2.1} -- Project 'app' depends onto com.google.firebase:firebase-core@{strictly 16.0.3} -- Project 'app' depends onto com.google.firebase:firebase-auth@{strictly 16.0.3} -- Project 'app' depends onto com.google.firebase:firebase-analytics@{strictly 16.0.3} -- Project 'app' depends onto com.google.android.gms:play-services-tasks@{strictly 17.0.0} -- Project 'app' depends onto com.google.firebase:firebase-iid-interop@{strictly 17.0.0} -- Project 'app' depends onto com.google.firebase:firebase-iid@{strictly 20.0.0} -- Project 'app' depends onto com.google.android.gms:play-services-basement@{strictly 17.0.0} -- Project 'app' depends onto com.google.firebase:firebase-database@{strictly 16.0.1} -- Project 'app' depends onto com.google.android.gms:play-services-stats@{strictly 17.0.0} -- Project 'app' depends onto com.google.firebase:firebase-common@{strictly 19.0.0} -- Project 'app' depends onto com.firebaseui:firebase-ui-database@{strictly 4.1.0} -- Project 'app' depends onto com.google.firebase:firebase-database-connection@{strictly 16.0.1} -- Project 'app' depends onto com.google.firebase:[email protected] -- Project 'app' depends onto com.google.firebase:[email protected] -- Project 'app' depends onto com.google.firebase:firebase-measurement-connector@{strictly 18.0.0} -- Project 'app' depends onto com.google.android.gms:play-services-flags@{strictly 15.0.1}

For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https:// github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b uild.gradle file.

Vikrant
5,05218 gold badges53 silver badges77 bronze badges
asked Oct 6, 2019 at 15:13

1 Answer 1

1
  • The problem is here

    Dependency failing: com.google.android.gms:play-services-flags:15.0.1 -> com.google.android.gms:play-services-basement@[ 15.0.1], but play-services-basement version was 17.0.0.

  • You need to update the version of gms:play-services-flags.

    implementation 'com.google.android.gms:play-services-flags:17.0.0' or higher

    (ref: https://developers.google.com/android/guides/releases)

    I hope it helps you.

answered Oct 7, 2019 at 3:45
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.