-
Notifications
You must be signed in to change notification settings - Fork 148
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
[bug] Screen Share on Android target API 34+ crashes (Media projections require a foreground service) #542
Comments
Related: JulianAssmann/flutter_background#85 |
Media projectionForeground service type to declare in manifest under Permission to declare in your manifest Constant to pass to startForeground() Runtime prerequisites After you have created the foreground service, you can call MediaProjectionManager.getMediaProjection(). Description Alternatives See: https://developer.android.com/about/versions/14/changes/fgs-types-required |
Hi, all! I have the same issue too. I'm using the latest livekit_client package version, and I added the required Android configurations, permissions and service. flutter_webrtc version is 0.10.8. |
Have you followed the screen sharing instructions, including adding the foreground service type in the service declaration? Calling startForeground without declaring the type will fallback to the service type declared in the manifest, meaning no change is needed in the |
@davidliu Yeah, I did add the permissions and service to the manifest file. |
Oh, I see what the problem is here. The problem isn't with the foreground service type; calling The problem is that the foreground service needs to be started only after receiving for the screenshare permission, but before the screenshare is actually started. This can be handled by calling I've added updates to the docs and example in #545. |
@davidliu I'll give this a quick test here this morning and write back results. Looks promising! Thanks for taking a look at all this! |
Working amazingly both in the example app and my own. Thank you guys so much. I am super grateful! 🙌 |
Describe the bug
After Android API level 34 (impacting Android 14), screen-share functionality according to the LiveKit documentation results in an app crash event.
Crash at 3:29 in video.
LiveKit.SS.Android.Bug-s.mp4
To Reproduce
Set the example app's build.gradle target SDK version to 34 or higher (currently 31).
Expected behavior
Android API level 34+ should have instructions documented to fix this issue. Otherwise, a general warning about targeting API 34+ should be added to the documentation.
Platform information
Android
Android API 34+ (equivalent to Android 14)
The text was updated successfully, but these errors were encountered: