I have been tryong to add FCM to my android application for almost 48 hours now. I am keep on failing with these two errors on Android Studio. I have tried all the solutions in this post. Still I couldn't fix it.
I want firebase cloud messaging to be integrated in my app. So I did the followings.
implementation 'com.google.firebase:firebase-messaging:17.0.0'
(In the app level gradle)apply plugin: 'com.google.gms.google-services'
(In the app level gradle file last line)classpath 'com.google.gms:google-services:4.0.1'
(In the project level gradle) google()
(In the project level gradle)I have tried syncing many times and I keep on getting the error
Failed to resolve: play-services-tasks Open File
Failed to resolve: play-services-basement Open File
On a side note, I am using the gradle plugin 3.1.3
classpath 'com.android.tools.build:gradle:3.1.3'
Can someone please give me a hand here please.
In gradle (project)
, just change the position of google()
before jcenter()
, and the error is gone.
repositories { google() jcenter() }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With