Failed To Resolve Target Intent Service, Error While Delivering The Message: Serviceintent Not Found
I try to make gcm work. When our server sends a push notification I got these two errors in my app's log: E/GcmReceiver(8049): Failed to resolve target intent service, skipping
Solution 1:
You should have these 3 services in your manifest. You're missing the one with the action com.google.android.c2dm.intent.RECEIVE
<serviceandroid:name="com.myapppackage.application.gcm.GcmIntentService"android:exported="false"><intent-filter><actionandroid:name="com.google.android.c2dm.intent.RECEIVE" /></intent-filter></service><serviceandroid:name="com.myapppackage.application.gcm.GcmIDListenerService"android:exported="false"><intent-filter><actionandroid:name="com.google.android.gms.iid.InstanceID" /></intent-filter></service><serviceandroid:name="com.myapppackage.application.gcm.RegistrationIntentService"android:exported="false"/>
Solution 2:
Adding firebase messaging dependency worked for me
implementation 'com.google.firebase:firebase-analytics:17.0.1'
implementation 'com.google.firebase:firebase-messaging:19.0.1'
Please note that firebase-messaging have a dependency on firebase-analytics
Solution 3:
Hey You need to add MyGcmListenerService class for receive notification:
publicclassMyGcmListenerServiceextendsGcmListenerService {
@OverridepublicvoidonMessageReceived(Stringfrom, Bundle data) {
String message = data.getString("message");
}
you need add this class as service in AndroidMaifest.xml
<serviceandroid:name="com.mypackage.application.services.MyGcmListenerService"android:exported="false" ><intent-filter><actionandroid:name="com.google.android.c2dm.intent.RECEIVE" /></intent-filter></service>
Solution 4:
just check gradle for required updated and then sync you app and run again that's worked for (maybe something wrong in firebase)
Post a Comment for "Failed To Resolve Target Intent Service, Error While Delivering The Message: Serviceintent Not Found"