I have an old app that was running perfectly Now I want to add FCM notification.
This is build.gradle (Module: app)
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:7.0.0'
//compile 'com.google.firebase:firebase-messaging:10.0.1'
}
apply plugin: 'com.google.gms.google-services'
The first error I got was
Error:(37, 0) Version: 7.0.0 is lower than the minimum version (9.0.0) required for google-services plugin.
I changed the version to be 9.0.0
code has become like this
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.firebase:firebase-messaging:10.0.1'
}
apply plugin: 'com.google.gms.google-services'
but I got this error
All com.google.android.gms libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 9.0.0, 10.0.1. Examples include com.google.android.gms:play-services:9.0.0 and com.google.android.gms:play-services-basement:10.0.1 more... (Ctrl+F1)
for that I changed the to version 10.0.1 as mentioned
the code has become like this
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
}
apply plugin: 'com.google.gms.google-services'
Now I get this error
Error:(802, 97) error: cannot find symbol method getMap()
the getMap function used to work fine before,
I am not sure which version of com.google.android.gms:play-services I have to use.
Thanks