Fatal Exception: java.lang.SecurityException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms (has extras) } without permission com.google.android.c2dm.permission.RECEIVE at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1419) at android.app.ContextImpl.startService(ContextImpl.java:1396) at android.content.ContextWrapper.startService(ContextWrapper.java:623) at com.google.firebase.iid.zzat.zze(Unknown Source:130) at com.google.firebase.iid.zzat.zzd(Unknown Source:91) at com.google.firebase.iid.zzat.zzc(Unknown Source:90) at com.google.firebase.iid.zzr.zza(Unknown Source:73) at com.google.firebase.iid.zzs.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) at java.lang.Thread.run(Thread.java:760)
1
votes
Post your manifest file
- Rahul Chandrabhan
I just integrated firebase crash and analytics SDK, and didn't use anything about FCM, but this problem has happened on many devices, not 100%, but it will happen frequently. I don't know how to locate and fix it
- Hante Han
reference github.com/HanteIsHante/file/issues/62 @RahulChandrabhan
- Hante Han
If you use a filter to intercept it, will you avoid this crash?
- Hante Han
2 Answers
0
votes
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).
0
votes
Make sure that you have added Receive permission in your android manifest.
You must also initialize runtime permission in code also it is now mandatory from api 23 and higher
if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECIEVE) != PackageManager.PERMISSION_GRANTED){
if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.RECIEVE)){
Toast.makeText(this, "Need Permission.", Toast.LENGTH_SHORT).show();
}else {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.RECIEVE}, MY_PERMISSIONS_REQUEST_RECIEVE);
}
}else{ // do noting
}
These are the runtime permissions!