I am creating android application 'GoogleCloudMessaging'. I Have found many that 'GcmListenerService' is being used and the old method 'GCMIntentService' is now deprecated. I have already install the Google Play service and add it into the dependency. But when i try to import
import com.google.android.gms.gcm.GcmListenerService;
it gives error "cannot resolve symbol." How can I import the Class? I refer https://developers.google.com/android/reference/com/google/android/gms/gcm/GoogleCloudMessaging and https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmListenerService.html#GcmListenerService() and follow the things but still unable to solve the problem.
If you have already added Google Play Services to your dependencies, the issue might be its version.
Try to update the line(in your build.gradle) to:
compile 'com.google.android.gms:play-services:7.5.0'
Then sync your project.
You must include
compile 'com.google.android.gms:play-services-gcm:11.0.4'
in your build.gradle file.
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