react-native-webrtc / react-native-webrtc/react-native-incall-manager
App crash with: java.lang.IllegalArgumentException: Receiver not registered: com.zxcpoiu.incallmanager.AppRTC.AppRTCBluetoothManager$BluetoothHeadsetBroadcastReceiver@21990f5
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 597
- Forks
- 201
- Avg merge
- 2h 42m
- Merged PRs (30d)
- 1
Description
Saw this application crash within incallmanager.
Looking at the error it looks like a bluetooth device disappeared under us?
java.lang.RuntimeException: Unable to destroy activity {com.xxxxx.MainActivity}: java.lang.IllegalArgumentException: Receiver not registered: com.zxcpoiu.incallmanager.AppRTC.AppRTCBluetoothManager$BluetoothHeadsetBroadcastReceiver@21990f5
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4634)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4652)
at android.app.ActivityThread.-wrap5(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1784)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:7000)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
Caused by: java.lang.IllegalArgumentException: Receiver not registered: com.zxcpoiu.incallmanager.AppRTC.AppRTCBluetoothManager$BluetoothHeadsetBroadcastReceiver@21990f5
at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:1219)
at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1518)
at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:664)
at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:664)
at com.zxcpoiu.incallmanager.AppRTC.AppRTCBluetoothManager.unregisterReceiver(AppRTCBluetoothManager.java:396)
at com.zxcpoiu.incallmanager.AppRTC.AppRTCBluetoothManager.stop(AppRTCBluetoothManager.java:285)
at com.zxcpoiu.incallmanager.InCallManagerModule.stop(InCallManagerModule.java:615)
at com.zxcpoiu.incallmanager.InCallManagerModule.stop(InCallManagerModule.java:597)
at com.zxcpoiu.incallmanager.InCallManagerModule.onHostDestroy(InCallManagerModule.java:1593)
at com.facebook.react.bridge.ReactContext.onHostDestroy(ReactContext.java:237)
at com.facebook.react.ReactInstanceManager.moveToBeforeCreateLifecycleState(ReactInstanceManager.java:687)
at com.facebook.react.ReactInstanceManager.onHostDestroy(ReactInstanceManager.java:596)
at com.facebook.react.ReactInstanceManager.onHostDestroy(ReactInstanceManager.java:610)
at com.facebook.react.ReactActivityDelegate.onDestroy(ReactActivityDelegate.java:117)
at com.facebook.react.ReactActivity.onDestroy(ReactActivity.java:70)
at android.app.Activity.performDestroy(Activity.java:7561)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1257)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4621)
... 9 more
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in AppRTCBluetoothManager.unregisterReceiver at line 396 and stop at line 285, then trace the lifecycle calls through InCallManagerModule.stop and onHostDestroy. Reproduce the activity-destruction path and verify that receiver cleanup no longer throws the reported IllegalArgumentException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100