firebase-android-sdk icon indicating copy to clipboard operation
firebase-android-sdk copied to clipboard

SecurityException: Not allowed to bind to service

Open brunoescalona-zz opened this issue 6 years ago • 56 comments

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in the code in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow with the firebase tag.
  • For general Firebase discussion, use the firebase-talk google group.
  • For help troubleshooting your application that does not fall under one of the above categories, reach out to the personalized Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: Android studio 4.0
  • Firebase Component: Messaging (Database, Firestore, Storage, Functions, etc)
  • Component version: 20.2.4

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

I am not able to reproduce the issue, mainly WIKO devices are affected by that one.

image

Relevant Code:

It seems that the Service cannot be bound due to security problems. I review my manifest permissions and I am including the com.google.android.c2dm.permission.RECEIVE permission, needed for the com.google.android.c2dm.intent.REGISTER intent.

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$3e27c581(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.firebase.iid.MessengerIpcClient$Connection.startConnection(MessengerIpcClient.java:25)
       at com.google.firebase.iid.MessengerIpcClient$Connection.enqueueRequest(MessengerIpcClient.java:9)
       at com.google.firebase.iid.MessengerIpcClient.sendRequest(MessengerIpcClient.java:20)
       at com.google.firebase.iid.MessengerIpcClient.sendOneWayRequest(MessengerIpcClient.java:14)
       at com.google.firebase.messaging.FirebaseMessagingService.ackMessage(FirebaseMessagingService.java:102)
       at com.google.firebase.messaging.FirebaseMessagingService.handleMessageIntent(FirebaseMessagingService.java:32)
       at com.google.firebase.messaging.FirebaseMessagingService.handleIntent(FirebaseMessagingService.java:23)
       at com.google.firebase.messaging.EnhancedIntentService.lambda$processIntent$0$EnhancedIntentService(EnhancedIntentService.java:43)
       at com.google.firebase.messaging.EnhancedIntentService$$Lambda$0.run(EnhancedIntentService.java:2000)
       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)

brunoescalona-zz avatar Oct 14 '20 12:10 brunoescalona-zz

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Oct 14 '20 12:10 google-oss-bot

Hi @brunoescalona, and thanks for the bug report! We're actively looking into similar reports (internal ref b/168922691) that seem to be affecting that same slice of devices, and this gives us another data point indicating it may be something device-specific. We haven't settled on a solution just yet, but the team has proposed a couple of different ideas and hopefully we'll have something to share here soon.

ciarand avatar Oct 15 '20 21:10 ciarand

Thanks @ciarand! I will wait for the possible solution.

brunoescalona-zz avatar Oct 16 '20 06:10 brunoescalona-zz

I noticed the same bug in an application I'm maintaining. So far it only occurred on Wiko View 4 devices running Android 10.

cbeyls avatar Nov 03 '20 12:11 cbeyls

Hello. We have the same error too. Only three devices prduced this Exception: Wiko View4 Lite, General Mobile GM10, Wiko View4 with Android 10.

IljaGnezdilov avatar Nov 05 '20 12:11 IljaGnezdilov

Hey @ciarand , are there any updates on this issue? Maybe there is already some plan for a mitigation? Or maybe some way to work around and prevent that crash? This problem is the cause of 50% of all crashes we are seeing within our app.

awenger avatar Nov 30 '20 09:11 awenger

Hey @ciarand another 2 weeks passed, any updates? Anything that we could do to fix/work around/debug/help solving this issue? We are counting 50k crashes caused by this problem with our latest release.

awenger avatar Dec 16 '20 13:12 awenger

Hi, we are also facing the same issue. Devices: 100% QMobile OS: 100% Android 10

mateensheikh avatar Dec 29 '20 10:12 mateensheikh

Hi! @ciarand could you push a bit this issue? Is one of our main crashes right now.

brunoescalona-zz avatar Dec 29 '20 10:12 brunoescalona-zz

I also noticed this crash on Cat S42 devices.

iskugor avatar Jan 04 '21 11:01 iskugor

Hello, We have the same problem in our app FranceTvSport It crashes on Wiko View4 , Wiko View4 Lite and Cat S42 and It is clear that your bug is still not fixed yet.
Can you please fix it or just respond to us. Many thanks !!

houssemzaier avatar Jan 13 '21 20:01 houssemzaier

Hi, We are also facing the same issue on QMobile. image

mshahabrauf avatar Feb 03 '21 06:02 mshahabrauf

Is there any update on that issue?

brunoescalona-zz avatar Feb 03 '21 07:02 brunoescalona-zz

Same

Screen Shot 2021-02-04 at 1 50 44 PM

Update (March 11): Still only happening on the same device, and still 100% occurring in background state.

qtehfw avatar Feb 04 '21 02:02 qtehfw

Same for me, crashed on Wiko View4

Albul avatar Feb 17 '21 12:02 Albul

Same issue here. any workaround steps maybe? please update.

tallior avatar Feb 21 '21 11:02 tallior

Same issue seen on a HUAWEI ART-L29 running Android 9.

Ruco avatar Feb 24 '21 10:02 Ruco

Same crash on CAT S42 / Android 10 devices.

iliaskomp avatar Feb 26 '21 07:02 iliaskomp

Same crash on Cat S42, Android 10 device

goralm128 avatar Mar 05 '21 09:03 goralm128

Same crash on 100% TINNO SUGAR T20,,SUGAR T30, Android 10 device

19snow93 avatar Mar 09 '21 02:03 19snow93