https://stackoverflow.com/questions/53954114
Fatal Exception: java.lang.SecurityException: Not allowed to bind to service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms }
at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1741)
at android.app.ContextImpl.bindService(ContextImpl.java:1651)
at android.content.ContextWrapper.bindService(ContextWrapper.java:705)
at com.google.android.gms.common.stats.ConnectionTracker.zza(ConnectionTracker.java:41)
at com.google.android.gms.common.stats.ConnectionTracker.zza(ConnectionTracker.java:10)
at com.google.android.gms.common.stats.ConnectionTracker.bindService(ConnectionTracker.java:43)
at com.google.android.gms.cloudmessaging.zzf.zza(zzf.java:17)
at com.google.android.gms.cloudmessaging.zze.zza(zze.java:18)
at com.google.android.gms.cloudmessaging.zze.zza(zze.java:12)
at com.google.android.gms.cloudmessaging.CloudMessagingReceiver.zzb(CloudMessagingReceiver.java:43)
at com.google.android.gms.cloudmessaging.CloudMessagingReceiver.zza(CloudMessagingReceiver.java:59)
at com.google.android.gms.cloudmessaging.zzd.run(zzd.java:10)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.android.gms.common.util.concurrent.zza.run(zza.java:6)
at java.lang.Thread.run(Thread.java:919)This happens when you installed an application that uses GCM before you installed GmsCore. Android was not able to grant the requires permission to the app because it did not know about the permission at all (because it is defined in GmsCore). To work around this issue you can re-install the app that causes the problem (no need to remove it, just install it again). 出處
firebase/firebase-android-sdk#1393 firebase/firebase-android-sdk#2062
We've added a workaround that should stop it from crashing in version 17.0.0 of the play-services-cloud-messaging library. The next release of the FCM SDK should update to use that version of the library, including the workaround. You could try to add that version of the dependency directly, but I believe since the new version of the library contains a breaking change, you may run into incompatibilities with the current version of the FCM SDK and it may not build.