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

Service not registered: com.google.android.gms.common.internal.zzf@20fb92a

Open jecksonwang opened this issue 6 years ago • 15 comments

Step 1: Describe your environment

  • Android device: Xiaomi MI 8 UD (equuleus)
  • Android OS version: 9.0
  • Google Play Services version: 17.0.0
  • Firebase/Play Services SDK version: 17.0.0

Step 2: Describe the problem:

app crash by the issue

Steps to reproduce:

Appears randomly and randomly during the process of using APP

Observed Results:

java.lang.IllegalArgumentException: at android.app.LoadedApk.forgetServiceDispatcher (LoadedApk.java:1570) at android.app.ContextImpl.unbindService (ContextImpl.java:1702) at android.content.ContextWrapper.unbindService (ContextWrapper.java:727) at com.google.android.gms.common.stats.ConnectionTracker.unbindService (Unknown Source:25) at com.google.android.gms.common.internal.zzf.zzf (Unknown Source:41) at com.google.android.gms.common.internal.zze.handleMessage (Unknown Source:45) at android.os.Handler.dispatchMessage (Handler.java:102) at com.google.android.gms.internal.common.zze.dispatchMessage (Unknown Source:8) at android.os.Looper.loop (Looper.java:201) at android.app.ActivityThread.main (ActivityThread.java:6806) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:873)

Expected Results:

no carsh

Relevant Code:

After integrating firebase in my project, I occasionally get the following error

Fatal Exception: java.lang.IllegalArgumentException: Service not registered: com.google.android.gms.common.internal.zzf@a87a29b at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1680) at android.app.ContextImpl.unbindService(ContextImpl.java:1781) at android.content.ContextWrapper.unbindService(ContextWrapper.java:730) at com.google.android.gms.common.stats.ConnectionTracker.unbindService(:25) at com.google.android.gms.common.internal.zzf.zzf(:41) at com.google.android.gms.common.internal.zze.handleMessage(:45) at android.os.Handler.dispatchMessage(Handler.java:102) at com.google.android.gms.internal.common.zze.dispatchMessage(:8) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7127) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)

I checked the related source code for zzf

public final void zzf(String var1) { zze.zzb(this.zzec).removeMessages(1, this.zzeb); zze.zzd(this.zzec).unbindService(zze.zzc(this.zzec), this); this.zzea = false; this.mState = 2; }

I would like to ask whether this service is bound by firebase, and when was it unbundled, why did this problem occur when unbundling?

jecksonwang avatar Mar 13 '20 07:03 jecksonwang

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 Mar 13 '20 07:03 google-oss-bot

Same issue,please fix this.

implementation 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'com.google.firebase:firebase-core:17.0.0'
...
apply plugin: 'com.google.gms.google-services'

image image

JoshLipan avatar Apr 20 '20 06:04 JoshLipan

Same issue,please fix this image image

TOPWN avatar May 21 '20 12:05 TOPWN

Same issue,please fix this image image

This issue first happened in version 7.0.3 of my app, in version 7.0.3 I upgraded the version of Android gradle plugin (from 2.3.2 to 3.5.2) . Is there any incompatibility between the firebase SDK and version 3.5.2 of gradle plugin?

TOPWN avatar May 21 '20 12:05 TOPWN

Thanks for your patience. Are you seeing the issue in specific locations and only on Xiaomi MI 8 UD devices?

ashwinraghav avatar May 29 '20 22:05 ashwinraghav

Thanks for your patience. Are you seeing the issue in specific locations and only on Xiaomi MI 8 UD devices?

bug1 BUG2 can find in huawei and samsung

jecksonwang avatar Jun 02 '20 07:06 jecksonwang

Firebase uses FirebaseInitProvider to obtain the Context without intrusion, and this Context is an instance of Application, so we can rewrite Application#unbindService(), and the unbindService() that is finally called will be captured here

@Override public void unbindService(ServiceConnection conn) { try { super.unbindService(conn); } catch (IllegalArgumentException e) { e.printStackTrace(); // do something, ignore or report... } }

TOPWN avatar Jun 12 '20 08:06 TOPWN

Firebase uses FirebaseInitProvider to obtain the Context without intrusion, and this Context is an instance of Application, so we can rewrite Application#unbindService(), and the unbindService() that is finally called will be captured here

@Override public void unbindService(ServiceConnection conn) { try { super.unbindService(conn); } catch (IllegalArgumentException e) { e.printStackTrace(); // do something, ignore or report... } }

same issue and i add these code in my application but it not worked.

CharlesTai avatar Jun 28 '20 07:06 CharlesTai

Getting similar issue .. Please update.

riteshmaddala avatar Sep 16 '20 22:09 riteshmaddala

Getting similar issue .. Please update.

NativeDevlopment avatar Oct 08 '20 13:10 NativeDevlopment

Getting similar issue .. Please fix it.

tochange avatar Jan 15 '21 06:01 tochange

Hi @jecksonwang Sorry for the long wait here. I'd like to confirm if you're still seeing this issue? I'd recommend using the latest SDK version in your app to ensure old known bugs are fixed.

Thanks!

aguatno avatar Oct 14 '21 11:10 aguatno

Hi @jecksonwang Sorry for the long wait here. I'd like to confirm if you're still seeing this issue? I'd recommend using the latest SDK version in your app to ensure old known bugs are fixed.

Thanks!

@aguatno I'm using the latest sdk version,but bugs still exist.

CharlesTai avatar Oct 15 '21 02:10 CharlesTai

Hey @jecksonwang. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Oct 22 '21 01:10 google-oss-bot

Since there haven't been any recent updates here, I am going to close this issue.

@jecksonwang if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

google-oss-bot avatar Oct 29 '21 01:10 google-oss-bot