We're building a Flutter app with video call functionality via Azure Communication Services. Since ACS doesn’t support Flutter natively, we developed a custom Flutter plugin. I am responsible for the Android implementation.
We're currently integrating screen sharing using Raw Media Access, following the guide here:
Azure ACS Raw Media Access for Android
We’ve implemented our own screen share service using MediaProjection to generate frames, then send them through a ScreenShareOutgoingVideoStream. However, as soon as we try to stream, we encounter this exception:
Failed to send frame: java.lang.IllegalStateException: Unknown error.
java9.util.concurrent.CompletionException: java.lang.IllegalStateException: Unknown error.
at java9.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
at java9.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:321)
at java9.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1813)
...
Caused by: java.lang.IllegalStateException: Unknown error.
at com.azure.android.communication.calling.NativeLibraryHelpers.checkStatus(NativeLibraryHelpers.java:1282)
...
Also:
2025-06-26 14:20:01.909 ScreenShareService E Failed to start screen sharing video on call: com.azure.android.communication.calling.CallingCommunicationException
To Reproduce
Setup ScreenShareOutgoingVideoStream from MediaProjection
Attempt to send stream to ACS call
Observe crash on sendFrame
Expected behavior
The outgoing raw stream should be accepted and displayed on remote participants' screens.
Additional context
🔗 GitHub Plugin Repo: nerdzlab/acs_plugin
📄 Problem File: ScreenShareService.kt
The error occurs after 260 line, the setup of stream is from 204 till 232 line.
We're building a Flutter app with video call functionality via Azure Communication Services. Since ACS doesn’t support Flutter natively, we developed a custom Flutter plugin. I am responsible for the Android implementation.
We're currently integrating screen sharing using Raw Media Access, following the guide here:
Azure ACS Raw Media Access for Android
We’ve implemented our own screen share service using MediaProjection to generate frames, then send them through a ScreenShareOutgoingVideoStream. However, as soon as we try to stream, we encounter this exception:
Failed to send frame: java.lang.IllegalStateException: Unknown error.
java9.util.concurrent.CompletionException: java.lang.IllegalStateException: Unknown error.
at java9.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
at java9.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:321)
at java9.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1813)
...
Caused by: java.lang.IllegalStateException: Unknown error.
at com.azure.android.communication.calling.NativeLibraryHelpers.checkStatus(NativeLibraryHelpers.java:1282)
...
Also:
2025-06-26 14:20:01.909 ScreenShareService E Failed to start screen sharing video on call: com.azure.android.communication.calling.CallingCommunicationException
To Reproduce
Setup ScreenShareOutgoingVideoStream from MediaProjection
Attempt to send stream to ACS call
Observe crash on sendFrame
Expected behavior
The outgoing raw stream should be accepted and displayed on remote participants' screens.
Additional context
🔗 GitHub Plugin Repo: nerdzlab/acs_plugin
📄 Problem File: ScreenShareService.kt
The error occurs after 260 line, the setup of stream is from 204 till 232 line.