I\'m starting to use the Firebase Cloud Messaging.
I have only the example code of the guide to use the Notifications and Analytics. If I don\'t install Analytics n
I had the same issue, as others said I used the same version for all firebase
libraries, but it didn't worked:
compile 'com.google.firebase:firebase-core:9.6.0'
compile 'com.google.firebase:firebase-messaging:9.6.0'
I found that I must use the same version for play-services
:
compile 'com.google.android.gms:play-services-analytics:9.6.0'
compile 'com.google.android.gms:play-services-base:9.6.0'
compile 'com.google.android.gms:play-services-gcm:9.6.0'
try this:
add
compile 'com.google.firebase:firebase-analytics:9.2.0'
and change this:
compile 'com.google.firebase:firebase-messaging:9.0.2'
to THIS (same version on all)
compile 'com.google.firebase:firebase-messaging:9.2.0'
if this doesn't work, put all firebase versions to 9.0.2, or 9.0.0
(To the people hoping for the resolution while referring to the above answers with latest Play-services and firebase libraries)
Beginning with version 15 of all Play services and Firebase libraries, version numbers adhere to the semantic versioning scheme.
Each Maven dependency matching com.google.android.gms:play-services-* and com.google.firebase:firebase-* is no longer required to have the same version number in order to work correctly at build time and at run time.
For More detailed explanation refer here : announcing new SDK versioning
Hope it will help to people using latest SDK versioning.
Also for people who have not migrated to AndroidX yet and who tries to update their Firebase and Play services base SDK's to latest which is 17.0.0 kindly refer below : June17,2019 release notes
Now to let you know what I did to fix my problem was to have the dependencies as follows:
app didn't work with following libs:
implementation 'com.google.firebase:firebase-core:16.0.9' implementation 'com.google.firebase:firebase-messaging:18.0.0' implementation 'com.google.firebase:firebase-analytics:16.5.0'
App worked with following:
implementation 'com.google.android.gms:play-services-base:16.1.0' implementation 'com.google.android.gms:play-services-location:16.0.0' implementation 'com.google.android.gms:play-services-analytics:16.0.8' implementation 'com.google.android.gms:play-services-ads:17.2.1' implementation 'com.google.firebase:firebase-core:16.0.8' implementation 'com.google.firebase:firebase-messaging:17.3.3' implementation 'com.google.firebase:firebase-analytics:16.4.0'
So basically I lowered down my firebase-messaging version along with analytics and it worked like a charm...
Try to change the Firebase Versions in build.gradle. It works to me!
The Versions must be the same:
compile 'com.google.firebase:firebase-analytics:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.2.0'
compile 'com.google.firebase:firebase-core:9.2.0'
For me, this works. I changed the versions.
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.firebase:firebase-database:9.4.0'
keep same version of all firebase tools which you are using...