Bala
Bala

Reputation: 41

Failed to resolve implementation 'com.google.firebase:firebase-messaging:15.0.2'

I am integrating Firebase messaging for a version. It is:

'com.google.firebase:firebase-messaging:15.0.2'

My classpath is:

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

I had faced the following error:

Failed to resolve: firebase-messaging Open File

Upvotes: 0

Views: 5047

Answers (3)

Seymur Mammadli
Seymur Mammadli

Reputation: 1814

According to the Guy4444 1 on the post 2 I have changed

implementation 'com.google.firebase:firebase-messaging:17.0.0:15.0.0'

to

implementation 'com.google.firebase:firebase-messaging:17.0.0'

and it solved the problem!

Upvotes: 1

Haris
Haris

Reputation: 14043

I got it resolved by changing

this

implementation 'com.google.firebase:firebase-messaging:17.0.0:15.0.0'

to this

 implementation 'com.google.firebase:firebase-messaging:17.0.0'

Upvotes: 0

Peter Haddad
Peter Haddad

Reputation: 80904

Change this:

classpath 'com.google.gms:google-services:3.2.0'
implementation 'com.google.firebase:firebase-messaging:15.0.2'

into this:

classpath 'com.google.gms:google-services:4.0.1'
implementation 'com.google.firebase:firebase-messaging:17.0.0'

Explanation:

Here in this case using firebase-messaging:15.0.2 with google-services:4.0.1 would work, since the most important thing was updating google-services above 3.2.0, and that's because google-services:3.3.0 is needed to be able to use the firebase library from version 15.0 and above. You can check this blog post. that explains the changes in versioning of firebase libraries.

But it is still better to update the google-services plugin to prevent any other errors with other dependencies.

Note:

The versions less than 15.0.0 are in google maven repository, so you can use them in gradle. But, you cannot mix version 15.0.0 with a version less than 15.0.0 and use google play services 4.0.1, as said in my answer here. That's why it is better to update firebase libraries to the latest versions.

Upvotes: 10

Related Questions