Sevket
Sevket

Reputation: 914

Google Play Services and Firebase conflicts

I want to use both firebase and google play services dependencies. But it causes some conflictings. When i add the play services dependency, then firebase dependency does not work. Do you know how to use both dependencies at the same time? Thank you.

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-messaging:12.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.android.gms:play-services:11.8.0'

Upvotes: 2

Views: 1284

Answers (2)

zfromg
zfromg

Reputation: 170

Versions of com.google.android.gms:* and com.google.firebase:* dependencies prior to 15.0.0 had to be at the same version. After 15.0.0, this is no longer the case. See https://developers.google.com/android/guides/versioning for more details.

It should be noted, you should also no longer use the com.google.android.gms:play-services catch-all monolithic target as this includes all Google Play services and Firebase libraries into your project, bloating your app unnecessarily as you are unlikely to need to use all targets. This usage had been discouraged for some time and was actually removed in v15.0.0 (https://developers.google.com/android/guides/releases#april_12_2018_-_version_1500)

Upvotes: 0

Peter Haddad
Peter Haddad

Reputation: 80944

Change this:

implementation 'com.google.android.gms:play-services:11.8.0'

into this:

implementation 'com.google.android.gms:play-services:12.0.1'

Upvotes: 2

Related Questions