Firebase notification Service not registered when sending message

Viewed 4831

I get these errors and app crashes when i send message to my device through firebase cloud messaging.

W/ConnectionTracker: Exception thrown while unbinding
    java.lang.IllegalArgumentException: Service not registered: com.google.android.gms.measurement.internal.zzji@e44a084
        at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1331)
        at android.app.ContextImpl.unbindService(ContextImpl.java:1495)
        at android.content.ContextWrapper.unbindService(ContextWrapper.java:648)
        at com.google.android.gms.common.stats.ConnectionTracker.zza(com.google.android.gms:play-services-basement@@17.3.0:55)
        at com.google.android.gms.common.stats.ConnectionTracker.unbindService(com.google.android.gms:play-services-basement@@17.3.0:50)
        at com.google.android.gms.measurement.internal.zzio.zzag(com.google.android.gms:play-services-measurement-impl@@17.6.0:245)
        at com.google.android.gms.measurement.internal.zzio.zzal(com.google.android.gms:play-services-measurement-impl@@17.6.0:262)
        at com.google.android.gms.measurement.internal.zzio.zzc(com.google.android.gms:play-services-measurement-impl@@17.6.0:336)
        at com.google.android.gms.measurement.internal.zzir.zza(com.google.android.gms:play-services-measurement-impl@@17.6.0:2)
        at com.google.android.gms.measurement.internal.zzai.run(com.google.android.gms:play-services-measurement-impl@@17.6.0:7)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at com.google.android.gms.measurement.internal.zzfs.run(com.google.android.gms:play-services-measurement-impl@@17.6.0:21)

I followed the instructions step by step from this page https://firebase.google.com/docs/cloud-messaging/android/receive

3 Answers

To simply solve this issue you should add your firebase messaging service class to your manifest file , in the application tag , add this code snippet

<service
     android:name=".YourFirebaseMessagingService" // here you need to put your class name
     android:exported="false">
     <intent-filter>
         <action android:name="com.google.firebase.MESSAGING_EVENT" />
     </intent-filter>
 </service>

this is happen from "firebase_admob" package. Change it to old version

In my case, firebase_admob: 0.10.2 was the problem.

It looks like to me that you need to add this implementation inside your project dependencies:

dependencies {
   ...
   implementation 'com.google.android.gms:play-services-basement:17.4.0'
   ...
}
Related