I'm trying to build an android react native app where we use both Google Analytics and Firebase and I ran into this issue when compiling:
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.0.0,16.0.0]], but resolves to 16.0.2. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
After analysis of our gradle scan (see pictures below), we found that we have one module requiring com.google.firebase:firebase-core
and another one requiring com.google.android.gms:play-services-analytics
.
Both of these modules requires play-services-measurement-base
but since these modules are downloaded on the different repository (one is google and the other one is maven). We noticed that version 16.0.2 is released only on google repository but not on maven's one (check images below).
We tried to disable dependencies check with no luck. If anyone has a solution for this issue or a way to contact google/maven about this issue.
google(), jcenter()
TEMPORARY SOLUTION: Explicitly exclude play-services-measurement-base
from Firebase like this:
implementation("com.google.firebase:firebase-core:16.0.1") {
exclude group: 'com.google.android.gms', module: 'play-services-measurement-base'
}
OR check the accepted answer.
you can either force the resolution to a specific version number:
configurations.all() {
resolutionStrategy.force "com.google.android.gms:play-services-measurement-base:16.0.2"
}
or exclude
version 16.0.0
from the conflicting module com.google.firebase:firebase-core
.