Skip to content
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.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app crash when try present #197

Open
odejinmi opened this issue Sep 17, 2022 · 1 comment
Open

app crash when try present #197

odejinmi opened this issue Sep 17, 2022 · 1 comment

Comments

@odejinmi
Copy link

Process: com.cloudwebrtc.flutterwebrtcdemo, PID: 22639
E/AndroidRuntime(22639): java.lang.SecurityException: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION
E/AndroidRuntime(22639): at android.os.Parcel.createException(Parcel.java:2071)
E/AndroidRuntime(22639): at android.os.Parcel.readException(Parcel.java:2039)
E/AndroidRuntime(22639): at android.os.Parcel.readException(Parcel.java:1987)
E/AndroidRuntime(22639): at android.media.projection.IMediaProjection$Stub$Proxy.start(IMediaProjection.java:231)
E/AndroidRuntime(22639): at android.media.projection.MediaProjection.(MediaProjection.java:58)
E/AndroidRuntime(22639): at android.media.projection.MediaProjectionManager.getMediaProjection(MediaProjectionManager.java:104)
E/AndroidRuntime(22639): at org.webrtc.ScreenCapturerAndroid.startCapture(ScreenCapturerAndroid.java:110)
E/AndroidRuntime(22639): at com.cloudwebrtc.webrtc.OrientationAwareScreenCapturer.startCapture(OrientationAwareScreenCapturer.java:62)
E/AndroidRuntime(22639): at com.cloudwebrtc.webrtc.GetUserMediaImpl$3.onReceiveResult(GetUserMediaImpl.java:479)
E/AndroidRuntime(22639): at android.os.ResultReceiver$MyRunnable.run(ResultReceiver.java:50)
E/AndroidRuntime(22639): at android.os.Handler.handleCallback(Handler.java:883)
E/AndroidRuntime(22639): at android.os.Handler.dispatchMessage(Handler.java:100)
E/AndroidRuntime(22639): at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(22639): at android.app.ActivityThread.main(ActivityThread.java:7386)
E/AndroidRuntime(22639): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(22639): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime(22639): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
E/AndroidRuntime(22639): Caused by: android.os.RemoteException: Remote stack trace:
E/AndroidRuntime(22639): at com.android.server.media.projection.MediaProjectionManagerService$MediaProjection.start(MediaProjectionManagerService.java:476)
E/AndroidRuntime(22639): at android.media.projection.IMediaProjection$Stub.onTransact(IMediaProjection.java:135)
E/AndroidRuntime(22639): at android.os.Binder.execTransactInternal(Binder.java:1021)
E/AndroidRuntime(22639): at android.os.Binder.execTransact(Binder.java:994)
E/AndroidRuntime(22639):

@Rexobias
Copy link

Here's the solution: flutter-webrtc/flutter-webrtc#979

The crash only happens when targetSdkVersion is higher than 28.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants