You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Android Studio version: Android Studio Iguana | 2023.2.1 Patch 1
Android Gradle Plugin version: 8.3.2
Firebase Component: Firebase Sessions
Component version: Firebase BoM 32.8.0
Steps to reproduce:
Not able to reproduce the issue, but we are getting dozens of crashes on a specific device of one of our customers:
Wind River, Armor 2, Android 7
Fatal Exception: java.lang.IllegalArgumentException: Service not registered: [obfuscated]
at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1331)
at android.app.ContextImpl.unbindService(ContextImpl.java:1528)
at android.content.ContextWrapper.unbindService(ContextWrapper.java:648)
at com.google.firebase.sessions.SessionLifecycleServiceBinderImpl.bindToService(SessionLifecycleServiceBinder.kt:65)
at com.google.firebase.sessions.SessionLifecycleClient.bindToService(SessionLifecycleClient.java:105)
at com.google.firebase.sessions.FirebaseSessions$1.invokeSuspend(FirebaseSessions.kt:53)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0$com-google-firebase-concurrent-CustomThreadFactory(CustomThreadFactory.java:47)
at com.google.firebase.concurrent.CustomThreadFactory$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:1047)
at java.lang.Thread.run(Thread.java:761)
Relevant Code:
I see that on that line, the class is trying to unbind a service that was unable to bind before:
if (!isServiceBound) {
appContext.unbindService(serviceConnection)
Log.i(TAG, "Session lifecycle service binding failed.")
}
The text was updated successfully, but these errors were encountered:
Fix for #5869.
`Fatal Exception: java.lang.IllegalArgumentException: Service not
registered: [obfuscated]` happens when the context calls `unbindService`
on a service connection that has not been bounded. Either due to
`SecurityException` or the existing service cannot be found from the map
of services that has been bounded.
Simulating tests by calling `unbindService` without initially calling
`bindService` will result to the same stacktrace as with the issue:
```
java.lang.IllegalArgumentException: Service not registered: com.example.testunbinding.MainActivity$onCreate$serviceConnection$1@8988566
at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1289)
at android.app.ContextImpl.unbindService(ContextImpl.java:1511)
at android.content.ContextWrapper.unbindService(ContextWrapper.java:648)
at com.example.testunbinding.MainActivity.onCreate$lambda$0(MainActivity.kt:48)
at com.example.testunbinding.MainActivity.$r8$lambda$mcIw03Dd4PpO0vDw0ScUjxsazkw(MainActivity.kt)
at com.example.testunbinding.MainActivity$$ExternalSyntheticLambda0.onClick(D8$$SyntheticClass:0)
```
I've verified that the try-catch for `IllegalArgumentException` works.
Steps to reproduce:
Not able to reproduce the issue, but we are getting dozens of crashes on a specific device of one of our customers:
Relevant Code:
I see that on that line, the class is trying to unbind a service that was unable to bind before:
The text was updated successfully, but these errors were encountered: