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
Unable to getUserMedia: Attempt to invoke virtual method 'android.content.Intent android.app.Activity.registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter)' on a null object reference
#1799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
} catch (e, s) {
print("error is $e");
print("stack stace is $s");
}
}
E/MethodChannel#FlutterWebRTC.Method(31010): Failed to handle method call
E/MethodChannel#FlutterWebRTC.Method(31010): java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Intent android.app.Activity.registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter)' on a null object reference
E/MethodChannel#FlutterWebRTC.Method(31010): at com.cloudwebrtc.webrtc.video.camera.DeviceOrientationManager.start(DeviceOrientationManager.java:57)
E/MethodChannel#FlutterWebRTC.Method(31010): at com.cloudwebrtc.webrtc.video.camera.CameraUtils.(CameraUtils.java:48)
E/MethodChannel#FlutterWebRTC.Method(31010): at com.cloudwebrtc.webrtc.MethodCallHandlerImpl.initialize(MethodCallHandlerImpl.java:176)
E/MethodChannel#FlutterWebRTC.Method(31010): at com.cloudwebrtc.webrtc.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:345)
E/MethodChannel#FlutterWebRTC.Method(31010): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/MethodChannel#FlutterWebRTC.Method(31010): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)
E/MethodChannel#FlutterWebRTC.Method(31010): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/MethodChannel#FlutterWebRTC.Method(31010): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
E/MethodChannel#FlutterWebRTC.Method(31010): at android.os.Handler.handleCallback(Handler.java:959)
E/MethodChannel#FlutterWebRTC.Method(31010): at android.os.Handler.dispatchMessage(Handler.java:100)
E/MethodChannel#FlutterWebRTC.Method(31010): at android.os.Looper.loopOnce(Looper.java:232)
E/MethodChannel#FlutterWebRTC.Method(31010): at android.os.Looper.loop(Looper.java:317)
E/MethodChannel#FlutterWebRTC.Method(31010): at android.app.ActivityThread.main(ActivityThread.java:8705)
E/MethodChannel#FlutterWebRTC.Method(31010): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#FlutterWebRTC.Method(31010): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
E/MethodChannel#FlutterWebRTC.Method(31010): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
I/flutter (31010): error is Unable to getUserMedia: Attempt to invoke virtual method 'android.content.Intent android.app.Activity.registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter)' on a null object reference
I/flutter (31010): stack stace is #0 MediaDeviceNative.getUserMedia (package:flutter_webrtc/src/native/mediadevices_impl.dart:48:7)
I/flutter (31010):
I/flutter (31010): #1 CallTaskHandler._handleOutGoingCall (package:adit.app/utils/forground_service/call_task_handler.dart:864:11)
I/flutter (31010):
The text was updated successfully, but these errors were encountered:
I experienced this issue with getUserMedia only when trying to answer a call while the app was in the background.
Due to Apple’s requirement to update apps for iOS 18, I updated the libraries and noticed that WebRTC stopped working in the background on Android starting from version "12.0.0", resulting in the same error you're seeing.
If your app doesn’t have issues using an older WebRTC version on Android, I recommend using "0.10.8", which works.
You can also try up to version "0.11.7" — I haven’t tested that one myself.
I am using flutter_webrtc plugin from sip_ua with flutter_foreground_task in between when I call this function which is mention below I got this error
_funcForCalling(String number) async {
try {
final mediaConstraints = <String, dynamic>{'audio': true, 'video': false};
} catch (e, s) {
print("error is $e");
print("stack stace is $s");
}
}
E/MethodChannel#FlutterWebRTC.Method(31010): Failed to handle method call
E/MethodChannel#FlutterWebRTC.Method(31010): java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Intent android.app.Activity.registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter)' on a null object reference
E/MethodChannel#FlutterWebRTC.Method(31010): at com.cloudwebrtc.webrtc.video.camera.DeviceOrientationManager.start(DeviceOrientationManager.java:57)
E/MethodChannel#FlutterWebRTC.Method(31010): at com.cloudwebrtc.webrtc.video.camera.CameraUtils.(CameraUtils.java:48)
E/MethodChannel#FlutterWebRTC.Method(31010): at com.cloudwebrtc.webrtc.MethodCallHandlerImpl.initialize(MethodCallHandlerImpl.java:176)
E/MethodChannel#FlutterWebRTC.Method(31010): at com.cloudwebrtc.webrtc.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:345)
E/MethodChannel#FlutterWebRTC.Method(31010): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/MethodChannel#FlutterWebRTC.Method(31010): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)
E/MethodChannel#FlutterWebRTC.Method(31010): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/MethodChannel#FlutterWebRTC.Method(31010): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
E/MethodChannel#FlutterWebRTC.Method(31010): at android.os.Handler.handleCallback(Handler.java:959)
E/MethodChannel#FlutterWebRTC.Method(31010): at android.os.Handler.dispatchMessage(Handler.java:100)
E/MethodChannel#FlutterWebRTC.Method(31010): at android.os.Looper.loopOnce(Looper.java:232)
E/MethodChannel#FlutterWebRTC.Method(31010): at android.os.Looper.loop(Looper.java:317)
E/MethodChannel#FlutterWebRTC.Method(31010): at android.app.ActivityThread.main(ActivityThread.java:8705)
E/MethodChannel#FlutterWebRTC.Method(31010): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#FlutterWebRTC.Method(31010): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
E/MethodChannel#FlutterWebRTC.Method(31010): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
I/flutter (31010): error is Unable to getUserMedia: Attempt to invoke virtual method 'android.content.Intent android.app.Activity.registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter)' on a null object reference
I/flutter (31010): stack stace is #0 MediaDeviceNative.getUserMedia (package:flutter_webrtc/src/native/mediadevices_impl.dart:48:7)
I/flutter (31010):
I/flutter (31010): #1 CallTaskHandler._handleOutGoingCall (package:adit.app/utils/forground_service/call_task_handler.dart:864:11)
I/flutter (31010):
The text was updated successfully, but these errors were encountered: