184

I updated to gradle 4.0.1 and started receiving following error

The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.4,15.0.4]], but resolves to 15.0.2. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

My project doesn't use that dependency so I searched globally for it, and it it only comes up inside

build/intermediates/lint-cache/maven.google/com/google/android/gms/group-index.xml

as this line

<play-services-measurement-base versions="15.0.0,15.0.2"/>

So I tried deleting my build folder and cleaning the project, but it regenerates it with same values :/ hence error still remains

Zoe
  • 27,060
  • 21
  • 118
  • 148
Ilja
  • 44,142
  • 92
  • 275
  • 498
  • _Resolved here:_ Me too faced the same problem when trying to add crashlytics in firebase. Please update the latest version of dependencies for **com.google.android.gms:play-services** and **com.google.firebase: ......**. It will automatically resolved the issues – Priya Rajan Oct 14 '18 at 21:12
  • I had the latest version and got this error so downgraded to 15.0.1 and it worked! – landrykapela Oct 17 '18 at 17:58
  • Please go to [this issue](https://issuetracker.google.com/issues/120759347) and star it. It seems there are a lot of problems because there were a lot of libraries unpublished from jCenter. – Patricio Sard Dec 11 '18 at 14:08

40 Answers40

187

The actual problem is discussed in the May, 23rd release note of https://developers.google.com/android/guides/releases#may_23_2018

Basically, you need to bump all Play Services and Firebase libraries to their latest version (which may be different for each since version 15). You may use https://mvnrepository.com/ to find the latest version for each library.

See also: https://firebase.google.com/support/release-notes/android#20180523

Beau Smith
  • 33,433
  • 13
  • 94
  • 101
Nico
  • 2,570
  • 1
  • 9
  • 17
  • 5
    http://maven.google.com is also suitable for looking up the released versions of these libraries. – PaulR May 29 '18 at 22:08
  • 59
    LifeSaver. Google should streamline this versioning. It's a pain – Dibzmania Jul 06 '18 at 08:21
  • 1
    Your answer helped me figure this out. But I had to use [this post](https://stackoverflow.com/questions/44404308/android-force-gradle-to-include-only-one-version-of-a-library) to actually get the correct versions included in my project and get past the errors. – Jacob Joel Jul 11 '18 at 17:20
  • 14
    I used the latest version of all libraries but the error remains. – stavros.3p Sep 13 '18 at 10:41
  • I had the same issue and used the https://mvnreposityory.com/ to find the latest google versions of the libraries in both of my gradle.build files and my issues were resolved. – Dane Lowrey Oct 21 '18 at 19:27
  • 2
    If you update all the libraries to their latest respective versions you get a warning that says "All gms/firebase libraries must use the exact same version specification (mixing versions can lead to runtime crashes)." Is this expected? How do you resolve this *as well* as the original problem? – user3369427 Nov 30 '18 at 01:15
84

only working solution for me:

put it on the bottom of build.gradle

com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
Gowthaman M
  • 8,057
  • 8
  • 35
  • 54
htw
  • 1,065
  • 7
  • 11
  • 10
    For me this solution hide the message, that is then raised in another way: "Android dependency 'com.google.android.gms:play-services-measurement-base' has different version for the compile (15.0.4) and runtime (16.0.0) classpath. You should manually set the same version via DependencyResolution" – ARLabs Jun 19 '18 at 09:52
  • Its the only solution that worked for me. Even with all gradle libraries up to date. – Neri Oct 12 '18 at 15:25
  • It works, but use it as a last resort. I sync'd all the Google Play and Firebase versions, but one library refused to accept that version (it was hardcoded to require one and only one specific version). – pmont Oct 19 '18 at 21:44
  • Here's a joke, `Firebase Android SDKs now have independent version numbers, allowing for more frequent, flexible updates.`. – Kimi Chiu Nov 22 '18 at 14:43
  • @htw thats a nope for me. – user2529011 Nov 30 '18 at 03:48
  • 22
    this is the worst one can do; ignoring the problem is not a "solution". – Martin Zeitler Dec 30 '18 at 15:22
  • This should be the accepted answer. Google just replaced their internal pain of releasing and testing many libs at the same version, with the pain of every other Android engineer having to deal with their inconsistencies! – Gesh Jan 29 '19 at 09:59
  • @Gowthaman M : sir i got error after put above in the build.gradle--- error: cannot find symbol public class FirebasePluginInstanceIDService extends FirebaseInstanceIdService { – Kapil Soni May 07 '19 at 11:19
  • not working for me, it just gives me a different error – hitautodestruct May 21 '19 at 06:47
31

Make Sure to keep Your Google play services dependencies and Firebase dependencies to latest version.

Also check all your gradle files, module level and project level, there has to be only one common version of dependency across all modules. Can be solved by keeping those versions in project level gradle variable.

Check here for Google play services update version

Google Play Services Latest

Check here for Firebase updated version

Firebase Latest

Check here for Firebase updated version for Android

Firebase Android Latest

abitcode
  • 1,420
  • 17
  • 24
  • this was useful. Using react-native and had to update the packages we were using to latest in these links. – publicknowledge Mar 07 '19 at 02:45
  • It can happen even if you depend on only a single Google lib! See my answer for why (very old Android Gradle plugin). – NateS Mar 16 '19 at 21:14
14

I updated

implementation 'com.google.android.gms:play-services-analytics:16.0.3'

and it works for me

Zoe
  • 27,060
  • 21
  • 118
  • 148
Amine M'hamed
  • 141
  • 1
  • 3
9

changing my build.gradle to the following worked for me:

ext {
  googlePlayServicesVersion   = "15.0.1"
}

allprojects {
  repositories {
      mavenLocal()
      maven { url 'http://maven.google.com' }
      jcenter { url "http://jcenter.bintray.com/" }
      google()
      maven {
        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url "$rootDir/../node_modules/react-native/android"
      }

      configurations.all {
        resolutionStrategy {
            force "com.google.android.gms:play-services-basement:$googlePlayServicesVersion"
            force "com.google.android.gms:play-services-tasks:$googlePlayServicesVersion"
        }
      }
  }
}
mk7danny
  • 91
  • 1
  • 1
  • thank you, it was helpful for me and solved my error. atleast gave me direction for next errors which i put them in same resolutionStrategy – Danish Nov 15 '18 at 18:15
  • To clarify, it's adding the `ext {...}` block to force the version that fixes the issue – RavenMan Nov 29 '18 at 09:15
7

In my case using latest versions of following dependencies solved my issue:

'com.google.android.gms:play-services-analytics:16.0.1'
'com.google.android.gms:play-services-tagmanager:16.0.1'
Gowthaman M
  • 8,057
  • 8
  • 35
  • 54
Murat
  • 3,084
  • 37
  • 55
5

This can happen if your Android Gradle plugin is very old, even if you are only using a single Google lib! Apparently all Google libs used to need to be the exact same version. Now they don't need to be the same, only the latest. When specifying even a single lib, it pulls in dependencies where the versions don't match and the old Android Gradle plugin pukes.

Set a newer version like:

buildscript {
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'
    }
}

You may need update your Gradle to use the newer plugin (it will tell you).

NateS
  • 5,751
  • 4
  • 49
  • 59
4

I was having an error The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.0.2,16.0.2]], but resolves to 16.0.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

Running ./gradlew :app:dependencies will reveal what dependencies are requiring wrong dependencies (the ones in the square bracket). For me the problem was coming from firebase-core:16.0.3 as shown below. I fixed it by downgrading firebase-core to 16.0.1

+--- com.google.firebase:firebase-core:16.0.3
|    +--- com.google.firebase:firebase-analytics:16.0.3
|    |    +--- com.google.android.gms:play-services-basement:15.0.1
|    |    |    \--- com.android.support:support-v4:26.1.0 (*)
|    |    +--- com.google.android.gms:play-services-measurement-api:[16.0.1] -> 16.0.1
|    |    |    +--- com.google.android.gms:play-services-ads-identifier:15.0.1
|    |    |    |    \--- com.google.android.gms:play-services-basement:[15.0.1,16.0.0) -> 15.0.1 (*)
|    |    |    +--- com.google.android.gms:play-services-basement:15.0.1 (*)
|    |    |    +--- com.google.android.gms:play-services-measurement-base:[16.0.2] -> 16.0.2
Eric Kim
  • 10,617
  • 4
  • 29
  • 31
3

Only solution that work for me (found some where in SOF)(don't have the link) is :

in top main build.grale

allprojects {

subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.google.android.gms'
                    && !details.requested.name.contains('multidex')) {
                details.useVersion "x.y.z"
            }
        }
    }
}
issamux
  • 1,336
  • 1
  • 19
  • 35
  • 3
    now I am getting different error `The library com.google.firebase:firebase-analytics is being requested by various other libraries at [[16.0.3,16.0.3]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.` – Eric Kim Sep 07 '18 at 08:34
3

Add to list of your dependencies. Now need to have it for proper work of all firebase dependencies:

implementation 'com.google.firebase:firebase-core:16.0.1'
PavelGP
  • 1,681
  • 1
  • 13
  • 11
3

I had the same issue

Just make sure that you have the latest versions of all the dependencies. I used the current versions for Firebase core and auth. The newer versions have bug fixes.

You can get the latest versions from here : https://firebase.google.com/support/release-notes/android

Using the latest version at current point of time:

in app/build.gradle :

dependencies {
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-auth:16.1.0'
}
shellym
  • 546
  • 1
  • 5
  • 11
3

A similar issue arose with me when I tried to add Firebase Database to my project.

implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.3'

The issue can be resolved by downgrading or upgrading both the versions to a similar level. So I downgraded firebase database to

implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'

and it worked! All available versions can be searched on this site: https://mvnrepository.com/

2

You can find the library pulling this dependancy using:

$ ./gradlew app:dependencies
Nico
  • 2,570
  • 1
  • 9
  • 17
  • 4
    This isn't working, it's just spits out the same error with no dependency graph. – jasonhudgins Jun 28 '18 at 18:31
  • 4
    you need to remove apply plugin: 'com.google.gms.google-services' line before trying this to avoid showing error – Kata Lune Jul 16 '18 at 15:06
  • 1
    I disabled the plugin, and checked dependencies. But there wasn't any library that had dependency to 15.0.4 as stated in exception ```The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.4,15.0.4], [16.0.0,16.0.0]], but resolves to 16.0.0.``` – miszmaniac Aug 15 '18 at 06:05
  • 1
    @miszmaniac I had the exact same issue. Downgrading both `play-services-analytics` and `firebase-core` to `16.0.0` solved the issue. – NoHarmDan Aug 24 '18 at 12:45
  • This new system of non equal versions for Firebase library is tragedy for now. Yesterday we had a random crash at app start, because firebase was not able to init() for some odd reason... we had to disable (in manifest) firebase-perf to be able to remove crash – miszmaniac Aug 28 '18 at 08:32
2

For me this error appeared after integrating Crashlytics via Firebase, due to a conflict of versions between

implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.android.gms:play-services-location:15.0.1'

I first tried downgrading Firebase Core to 15.0.1, but it seems there is no such version, only 15.0.0 and 15.0.2! Instead I had to downgrade both to version 15.0.0, so I ended up with

implementation 'com.google.firebase:firebase-core:15.0.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'

So now it's working, but I get those annoying Lint warnings about newer versions being available. This versioning debacle is a freakin' mess.

Magnus
  • 17,157
  • 19
  • 104
  • 189
2

In my case I have replaced my build.gradle file this line

implementation 'com.google.firebase:firebase-core:16.0.8'

with

implementation 'com.google.firebase:firebase-core:15.0.0' 

and added this line

implementation 'com.google.android.gms:play-services-location:15.0.0'

Now its fine

Swaroop Maddu
  • 4,289
  • 2
  • 26
  • 38
1

I guess the following error is caused because of the varying versions of firebase dependencies. For me changing the version of all the dependencies that i'm implementing on my project to 16.0.1, worked like a charm.

For me the error was created by the line: com.google.firebase:firebase-auth:16.0.2

And I changed it to : com.google.firebase:firebase-auth:16.0.1

And it worked.. Hope this helps.

Corey
  • 1,217
  • 3
  • 22
  • 39
1

I was bumping into this problem, and noticed that the release notes mentioned:

Firebase now requires the app gradle file to explicitly list com.google.firebase:firebase-core as a dependency for Firebase services to work as expected.

Making firebase-core an app dependency (as well as a library dependency) resolved this problem for me.

Tad
  • 4,668
  • 34
  • 35
1

1. Open project level build.gradle

Update com.google.gms:google-services version to latest. Track latest release. At the time of answer latest is 4.1.0.

2. Open app level build.gradle

Update below dependency if you use any. Note that firebase has individual versions for every dependency now.

Use latest Firebase Libraries. At the time of answer latest versions are below.

Firebase Core                com.google.firebase:firebase-core:16.0.3
Ads                          com.google.firebase:firebase-ads:15.0.1
Analytics                    com.google.firebase:firebase-analytics:16.0.3
App Indexing                 com.google.firebase:firebase-appindexing:16.0.1
Authentication               com.google.firebase:firebase-auth:16.0.3
Cloud Firestore              com.google.firebase:firebase-firestore:17.1.0
Cloud Functions              com.google.firebase:firebase-functions:16.1.0
Cloud Messaging              com.google.firebase:firebase-messaging:17.3.2
Cloud Storage   c            om.google.firebase:firebase-storage:16.0.2
Crash Reporting              com.google.firebase:firebase-crash:16.2.0
Crashlytics                  com.crashlytics.sdk.android:crashlytics:2.9.5
Dynamic Links                com.google.firebase:firebase-dynamic-links:16.1.1
Invites                      com.google.firebase:firebase-invites:16.0.3
In-App Messaging             com.google.firebase:firebase-inappmessaging:17.0.1
In-App Messaging Display     com.google.firebase:firebase-inappmessaging-display:17.0.1
ML Kit: Model Interpreter    com.google.firebase:firebase-ml-model-interpreter:16.2.0
ML Kit: Vision               com.google.firebase:firebase-ml-vision:17.0.0
ML Kit: Image Labeling       com.google.firebase:firebase-ml-vision-image-label-model:15.0.0
Performance Monitoring       com.google.firebase:firebase-perf:16.1.0
Realtime Database            com.google.firebase:firebase-database:16.0.2
Remote Config                com.google.firebase:firebase-config:16.0.0

Sync and Build...

Community
  • 1
  • 1
Khemraj Sharma
  • 57,232
  • 27
  • 203
  • 212
1

I noticed that debug logs mention old version of firebase-analytics (16.0.0). Adding explicitly the latest version fixed the problem:

implementation "com.google.firebase:firebase-analytics:16.0.3"
smok
  • 1,658
  • 13
  • 13
1

Update all your dependencies to the latest version and it will fix the issue.

No need to add
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

It will lead to crashes if you use mixed versions.

NIMISHAN
  • 1,265
  • 4
  • 20
  • 29
1

In my case, this solves the issue:

implementation 'com.google.android.gms:play-services-analytics:16.0.1'
Zoe
  • 27,060
  • 21
  • 118
  • 148
Kishore Reddy
  • 2,394
  • 1
  • 19
  • 15
1

I have similar issue which resolved by :

  1. In app level gradle: Update all firebase dependencies to the latest version latest
  2. In project level gradle : update the dependency to the latest: gms.google-services, In my case it was: 'com.google.gms:google-services:4.2.0'
tabebqena
  • 1,204
  • 1
  • 13
  • 23
  • this is where the magic lies. All dependencies in the app/build.gradle and then the topmost build.gradle file update all dependencies – CanCoder Oct 11 '19 at 14:21
1

I changed the following dependencies in my project to make it work .

build.gradle (app):

implementation 'com.google.firebase:firebase-core:16.0.1'

to

implementation 'com.google.firebase:firebase-core:16.0.8'

build.gradle (app) :

classpath 'com.google.gms:google-services:4.0.1'

to

classpath 'com.google.gms:google-services:4.2.0'

****Note :

Use the following link for updated use of libraries that have dependencies https://firebase.google.com/docs/android/setup

Muhammad Ali
  • 179
  • 1
  • 10
1

Use the updated version of Firebase and avoid extras. This is enough (but if you need to use storage space or .. you should add them too)

//FIREBASE
implementation 'com.google.firebase:firebase-core:17.2.0'
 implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
//ADMob
implementation 'com.google.android.gms:play-services-ads:18.2.0'
//PUSH NOTIFICATION
implementation 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'com.google.firebase:firebase-core:17.2.0'

and update the google-services :

 classpath 'com.google.gms:google-services:4.3.2'
Sana Ebadi
  • 6,656
  • 2
  • 44
  • 44
0

I my case i use latest rnfirebase below URL

https://rnfirebase.io/docs/v4.3.x/installation/android

add below in android/app/proguard-rules.pro)

-keep class io.invertase.firebase.** { *; }
-dontwarn io.invertase.firebase.**
krish
  • 3,856
  • 2
  • 24
  • 28
0

If the message is:

The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.4,15.0.4]], but resolves to 15.0.2. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

Change the version of all the play services libraries you are using to the one you need (15.0.2 in this case) could solve the problem.

In my case, I've changed:

implementation 'com.google.android.gms:play-services-base:+' -> implementation 'com.google.android.gms:play-services-base:15.0.2'
implementation 'com.google.android.gms:play-services-location:+' -> implementation 'com.google.android.gms:play-services-location:15.0.2'
implementation 'com.google.android.gms:play-services-maps:+' -> implementation 'com.google.android.gms:play-services-maps:15.0.2'
implementation 'com.google.android.gms:play-services-auth:+' -> implementation 'com.google.android.gms:play-services-auth:15.0.2'
implementation 'com.google.android.gms:play-services-places:+' -> implementation 'com.google.android.gms:play-services-places:15.0.2'
Jose Q
  • 441
  • 1
  • 4
  • 14
0

replace the "+" with version number, it would choose the latest version. like this:

implementation 'com.google.firebase:firebase-analytics:+'
Zoe
  • 27,060
  • 21
  • 118
  • 148
  • Don't ever do that. It's very bad answer, it can lead to multiple crashes and changes which you will never now.. because this will always request new version of library. – mmmatey Oct 15 '18 at 07:36
  • just saying that using the latest version should not be a problem. But it will probably be. this whole problem comes from trying to use latest versions. – Lassi Kinnunen Nov 08 '18 at 04:57
0

Resolved here: Me too faced the same problem when trying to add crashlytics in firebase. Please update the latest version of dependencies for com.google.android.gms:play-services and com.google.firebase: ....... It will automatically resolved the issues

Priya Rajan
  • 687
  • 8
  • 21
0

I had that same problem when I tried to add the firebase-database implementation, if I commented that line it works, so after a few tries I went to https://firebase.google.com/docs/android/setup

There I checked the versions of the available libraries and my firebase-core was at 16.0.1 (current version is 16.0.4) so I manually changed it and it worked just fine, build and sync were successful.

Anibal
  • 39
  • 6
0

In my case I simply remove

implementation "com.google.android.gms:play-services-ads:16.0.0

and add firebase ads dependencies

implementation 'com.google.firebase:firebase-ads:17.1.2'
code4rox
  • 941
  • 9
  • 34
0

Had the same issue. You have to remove the colon : after the version in the gradle (it's a bug).

These settings worked for me:

implementation 'com.google.firebase:firebase-firestore:17.1.5'

Also set multiDexEnabled to true in the gradle (if you get the DexOverflowException error):

    android {
        compileSdkVersion 27
..
            multiDexEnabled true
        }
live-love
  • 48,840
  • 22
  • 240
  • 204
0

just put below code:

    implementation 'com.google.firebase:firebase-core:16.0.6'
    implementation 'com.google.firebase:firebase-database:16.0.6'

and rebuild. it works just for fine for me

shafri
  • 51
  • 4
0

firebase-core & firebase-database ... should be same version:

implementation 'com.google.firebase:firebase-core:16.0.1' implementation 'com.google.firebase:firebase-database:16.0.1'

0

I have same problem, then I solved to chanced implementation 'com.google.firebase:firebase-auth:15+' instead implementation 'com.google.firebase:firebase-auth:16.1.0'

0

here is a simple solution. the problem is because you are using latest version for one library and lower version for the other library. try to balance it. the best solution is to use latest version for all of your libraries. To solve your problem simply click here and see the latest version of libraries and include it in you project and then synchronize it.
in my case the following is working for me:

dependencies{
    implementation 'com.google.firebase:firebase-core:16.0.7'
    implementation 'com.google.firebase:firebase-database:16.1.0'
}
apply plugin: 'com.google.gms.google-services'
Abdulhakim Zeinu
  • 3,333
  • 1
  • 30
  • 37
0

This can be resolved by using latest set of dependencies.

You can find the latest ones on the site below

https://firebase.google.com/support/release-notes/android#20180523

Post that sync again and it should work fine

0

I was getting a similar error when I was trying to use the same version for everything:

implementation 'com.google.android.gms:play-services-base:16.0.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.0'
implementation 'com.google.android.gms:play-services-awareness:16.0.0'
implementation 'com.google.android.gms:play-services-cast:16.0.0'
implementation 'com.google.android.gms:play-services-gcm:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.firebase:firebase-messaging:16.0.0'

The problem was fixed for me when I did the following:

1) Used the latest version available of each service:

implementation 'com.google.android.gms:play-services-base:16.1.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.8'
implementation 'com.google.android.gms:play-services-awareness:16.0.0'
implementation 'com.google.android.gms:play-services-cast:16.2.0'
implementation 'com.google.android.gms:play-services-gcm:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.firebase:firebase-messaging:17.6.0'

2) Upgraded Android Studio to the latest version available today (Android Studio 3.4).

3) Upgraded Android Gradle Plugin Version to 3.4.0 and Gradle Version to 5.1.1.

Jaime Montoya
  • 6,915
  • 14
  • 67
  • 103
0

I Have got same error but My case was diffrent I have use Both Audience Network and Firebase.

I got this error

Android dependency 'com.google.android.gms:play-services-basement' has different version for the compile (11.0.4) and runtime (16.0.1) classpath. You should manually set the same version via DependencyResolution

Here is solution if you are using audience-network

implementation ("com.facebook.android:audience-network-sdk:$rootProject.fb_version")
{
    exclude group: 'com.google.android.gms'
}
Nikunj Paradva
  • 15,332
  • 5
  • 54
  • 65
0

I already use all the latest dependencies. It turned out I was missing a permission in AndroidManifest. Adding this permission fixed the error:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

As stated in their documentation: https://developers.google.com/android/guides/permissions

August Kimo
  • 1,503
  • 8
  • 17
-1

Cause

This error happened when one or more of your firebase or google play service library is an old version.

Solution

Simply Update all libraries to latest version.

If you have to use the old version (for example for sanctions or other reasons) follow this:

  • add googleServices.disableVersionCheck = true to end of your app/build.Gradle file
  • run the project and find duplicate library or library with a dependency issue
  • add them to exclude for the old(s) library.

Example

// remote config uses the old version
implementation('com.google.firebase:firebase-config:16.1.3') {   
    exclude group: 'com.google.firebase', module: 'firebase-analytics'
    exclude group: 'com.google.firebase', module: 'firebase-analytics-impl'
    exclude group: 'com.google.android.gms', module: 'play-services-measurement'
    exclude group: 'com.google.android.gms', module: 'play-services-measurement-impl'
}
implementation 'com.google.firebase:firebase-analytics:17.4.0'
implementation 'com.google.firebase:firebase-messaging:20.1.6'
implementation 'com.google.firebase:firebase-crashlytics:17.0.0'
Amir Hossein Ghasemi
  • 20,623
  • 10
  • 57
  • 53