Need help to fix error and add FCM code in my Android app

时间:2017-04-09 23:43:42

标签: android firebase push-notification firebase-cloud-messaging

I am adding Firebase Cloud Messaging.

When I go to add app level gradle code (line as mentioned below) as written on Firbase instructions:

apply plugin: 'com.google.gms.google-services' 

I am getting error. Appreciate any help.

enter image description here

1 个答案:

答案 0 :(得分:0)

Move the apply plugin... statement to after the dependencies block:

dependencies {
    ...
}
apply plugin: 'com.google.gms.google-services'

Update the version of all play-services-* and firebase-* libraries to at least 9.0.2. The current version is 10.2.1. Be sure to use the same version of all play-services-* and firebase-* libraries.