question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

I used the following libraries:

    implementation 'com.google.firebase:firebase-perf:19.0.5'/*Firebase Performance*/
    implementation 'com.google.firebase:firebase-config:19.1.3'/*Firebase Remote Config*/
    implementation 'com.google.firebase:firebase-analytics:17.2.2'/*Firebase Analytics*/
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'/*Firebase Crashlytics*/
    implementation 'com.crashlytics.sdk.android:crashlytics-ndk:2.1.1' 

I encountered the following problems:

image image image

Relevant Code:

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:1523)
       at android.app.ContextImpl.startService(ContextImpl.java:1500)
       at android.content.ContextWrapper.startService(ContextWrapper.java:624)
       at i.e.c.i.p.c(com.google.firebase:firebase-iid@@20.0.2:28)
       at i.e.c.i.p.b(com.google.firebase:firebase-iid@@20.0.2:1)
       at i.e.c.i.p.a(com.google.firebase:firebase-iid@@20.0.2:69)
       at i.e.c.i.m0.run(com.google.firebase:firebase-iid@@20.0.2:1)
       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:761)

Everyone, have you met

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:8
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
HanteIsHantecommented, Apr 10, 2020

This is the permission I used:

<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
    <permission
        android:name="${applicationId}.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

Even if the above permissions are added, there will still be such a crash。

1reaction
androidevelopercommented, Dec 3, 2021

Seems duplicate of with https://github.com/firebase/firebase-android-sdk/issues/2062 which was fixed in firebase-messaging:23.0.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not allowed to start service Intent { act=com.google.android ...
This app has permission to register and receive data message. --> <uses-permission android:name="com.google.android.c2dm.permission.
Read more >
Not allowed to start service Intent without permission
SecurityException: Not allowed to start service Intent without permission ... REGISTER pkg=com.google.android.gsf (has extras) } without permission ...
Read more >
Android Cloud to Device Messaging (C2DM) - Tutorial
This will trigger a service which will send the registration to the Google C2DM servers. The intent include an extra with the key...
Read more >
SecurityException: Not allowed to bind to service - Reddit
c2dm.permission.RECEIVE" /> but it is auto-added by the Google Play services plugin. The issue is already reported on Firebase SDK Issue ...
Read more >
Not allowed to start service Intent act=com.google.android ...
I get the error SecurityException: Not allowed to start service Intent but looks ... REGISTER pkg=com.google.android.gms (has extras) } without permission ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found