Skip to content

[BUG] Unable to Send Raw Video Stream for Screen Sharing — IllegalStateException: Unknown error #1938

@DmytroGulko

Description

@DmytroGulko

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions