I am getting following error when trying to configure Push Notification:
06-07 01:05:59.735 18708-18708/com.ebr.apps.ebr.development E/FirebaseInstanceId: Failed to resolve target intent service, skipping classname enforcement
06-07 01:05:59.735 18708-18708/com.ebr.apps.ebr.development E/FirebaseInstanceId: Error while delivering the message: ServiceIntent not found.
I have different flavors in gradle:
My code package name is : com.ebr.apps.ebr
My product flavor package is: com.ebr.apps.ebr.development
I have placed google-services.json in app/src/development
Manifest:
<permission
android:name="${applicationId}.permission.C2D_MESSAGE"
android:protectionLevel="signature"/>
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/>
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="${applicationId}" />
</intent-filter>
</receiver>
<service
android:name=".GCM.PushNotificationService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>
I have looked at many example but still getting this error.
I found the solution, the problem was that Instabug GCMListener was conflicting with my GCMListener. I set the priority of my gcm listener and it started working.
<service
android:name=".GCM.PushNotificationService"
android:exported="false">
<intent-filter android:priority="10000">
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>
If your coming from a search engine: you might have as well run into this bug, which affects also the current version com.google.android.gms:play-services-gcm:9.8.0
https://github.com/firebase/quickstart-android/issues/72
It was not yet possible to reproduce the bug and it is not fully understood how the situation can happen but you might be interested in following the thread.
Related
I have been getting two errors in my log once a notification is received
EnhancedIntentService: Service took too long to process intent: com.google.android.c2dm.intent.RECEIVE App may get closed
EnhancedIntentService: binding to the service failed
There is NOTHING on Google of either of these messages or even EnhancedIntentService.
Relevant code:
<service
android:name="---.GcmMCIntentService"
android:exported="false" >
<intent-filter android:priority="10">
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name="---.GCMInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
<service android:name="---.GCMRegIntentService"
android:exported="false" >
<intent-filter android:priority="5">
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
This is on a 8.0 emulator. Play Services 11.4.2
Let me know if I can show any other code. I just find it curious there is nothing on these error messages at all on S.O. or Google.
We are using Parse Push Plugin https://github.com/taivo/parse-push-plugin with custom parse server. Push messages are coming to the device into GCMService but not rendering. The ParsePushBroadcastReceiver not sure if its being invoked. I don't see any errors in logs.
Also on debugging i see that GCM Receive Intent's are getting called, and not
com.parse.push.intent.RECEIVE , not sure if its default behaviour.
I have the following in AndroidManifest.xml , Also i am using parse android version com.parse:parse-android:1.13.1
<receiver android:exported="false" android:name="github.taivo.parsepushplugin.ParsePushPluginReceiver">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="${applicationId}" />
</intent-filter>
</receiver>
Any help would be of greatly appreciated
I followed the instructions here to set up a client GCM app: https://developers.google.com/cloud-messaging/android/client
I opted to use the standard GCM rather than the new Firebase Cloud Messaging, for now.
My app server is a node.js instance using node-gcm to send push notifications.
My app receives the notifications successfully, however prints out the following errors:
E/FirebaseInstanceId: Failed to resolve target intent service, skipping classname enforcement
E/FirebaseInstanceId: Error while delivering the message: ServiceIntent not found.
Here are the relevant bits of my AndroidManifest.xml:
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.example.myapp" />
</intent-filter>
</receiver>
<service
android:name="com.example.myapp.gcm.GcmListener"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name="com.example.myapp.gcm.InstanceIDListener"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
<service android:name="com.example.myapp.gcm.RegistrationIntentService"
android:exported="false" />
My project has all of the above classes (minus GcmReceiver which is provided by Google).
GcmReceiver extends GcmListenerService
InstanceIDListener extends InstanceIDListenerService
RegistrationIntentService extends IntentService
Am I missing anything that might be causing this error? Does the error actually affect anything?
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
classname enforcement E/GcmReceiver(8049): Error while delivering the
message: ServiceIntent not found.
In my app's folder I got the google-services.json file.
I have added the 2 needed services and the receiver to my Manifest:
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.myapppackage.application" />
</intent-filter>
</receiver>
<service
android:name="com.myapppackage.application.gcm.newgcm.RegisterGCMTokenService"
android:exported="false">
</service>
<service
android:name="com.myapppackage.application.gcm.newgcm.MyInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
I have also added these two as java classes. The gcm token providing and uploading to our server's is fine. I also got the push 'event' but somehow I got those 2 errors above, and no messages.
I have added my project number from google api console to strings.xml as 'google_app_id'
The API keys should be all right because I do get the push event, but somehow the message is not provided.
My gradle's app level dependencies have:
compile 'com.google.android.gms:play-services:8.+'
My gradle's project level dependencies have:
classpath 'com.google.gms:google-services:1.3.1'
So what the heck?! Please help me if you can.
You should have these 3 services in your manifest. You're missing the one with the action com.google.android.c2dm.intent.RECEIVE
<service
android:name="com.myapppackage.application.gcm.GcmIntentService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name="com.myapppackage.application.gcm.GcmIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
<service
android:name="com.myapppackage.application.gcm.RegistrationIntentService"
android:exported="false"/>
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
Hey You need to add MyGcmListenerService class for receive notification:
public class MyGcmListenerService extends GcmListenerService {
#Override
public void onMessageReceived(String from, Bundle data) {
String message = data.getString("message");
}
you need add this class as service in AndroidMaifest.xml
<service android:name="com.mypackage.application.services.MyGcmListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
just check gradle for required updated and then sync you app and run again
that's worked for (maybe something wrong in firebase)
Baidu provide android SDK for push notification in eclipse project. It run well but no in android studio. I get errorCode 10101 (Integrate Check Error) Anyone know ?
Error 10101 indicated that there's something wrong with the core libs of baidu push services. From what i've experienced, it usually means that one of the .so libraries isn't loaded right, or isn't correlate with your definitions. For example, if you have a device which goes to armeabi-v7a folder, and the libbdpush_.so file there isn't right, then that device won't be able to connect to baidu's push services.
Baidu's guide : http://push.baidu.com/doc/android/api
Have you imported all the required libraries and made all the configurations ?
If you've made all the following steps, and still, you're receiving error 10101 it means that the specific phone you have doesn't have the right .so lib under its correlate core lib folder.
Download the baidu sdk http://boscdn.bpc.baidu.com/channelpush/14/dZoOygdDPxB7SecReFnwNDDG/com.neura.weave/PushDemo.zip
Import the core libs (PushDemo -> libs) to your project (project -> src -> main -> jniLibs)
Import the push service library (pushservice-_.jar) to your project (project -> libs)
Adjust your manifest
<receiver
android:name="com.baidu.android.pushservice.PushServiceReceiver"
android:process=":bdservice_v1">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<action android:name="com.baidu.android.pushservice.action.notification.SHOW" />
<action android:name="com.baidu.android.pushservice.action.media.CLICK" />
<action android:name="android.intent.action.MEDIA_MOUNTED" />
<action android:name="android.intent.action.USER_PRESENT" />
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
</intent-filter>
</receiver>
<receiver
android:name="com.baidu.android.pushservice.RegistrationReceiver"
android:process=":bdservice_v1">
<intent-filter>
<action android:name="com.baidu.android.pushservice.action.METHOD" />
<action android:name="com.baidu.android.pushservice.action.BIND_SYNC" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<data android:scheme="package" />
</intent-filter>
</receiver>
<service
android:name="com.baidu.android.pushservice.PushService"
android:exported="true"
android:process=":bdservice_v1">
<intent-filter>
<action android:name="com.baidu.android.pushservice.action.PUSH_SERVICE" />
</intent-filter>
</service>
<service
android:name="com.baidu.android.pushservice.CommandService"
android:exported="true" />
<meta-data
android:name="api_key"
android:value="put_your_baidu_api_key_here" />