Closed
Description
[Bug] Failed to Set Remote Answer SDP Due to m-lines Order Mismatch on Android 13
Describe the bug
When attempting to set a remote answer SDP in a WebRTC connection, the process fails with the error: Failed to set remote answer sdp: The order of m-lines in answer doesn't match order in offer. Rejecting answer.
This prevents the WebRTC connection from being established properly.
To Reproduce
Steps to reproduce the behavior:
- Set up a WebRTC peer connection using
@livekit/react-native
and@livekit/react-native-webrtc
. - Join a room (e.g.,
room-452a6def
) with a participant (e.g.,test
). - Attempt to set the remote answer SDP received from the server.
- See the error logged in the console.
Expected behavior
The remote answer SDP should be successfully applied, allowing the WebRTC connection to proceed without errors.
Screenshots

Device Info:
- Device: Xiaomi M2101K6G (Redmi Note 10 Pro)
- OS: Android 13
Dependencies Info:
@livekit/react-native
: ^2.6.5@livekit/react-native-expo-plugin
: ^1.0.1@livekit/react-native-webrtc
: ^125.0.9
Additional context
The issue seems to stem from a mismatch in the m-lines
order between the offer and answer SDPs. Below are the relevant logs and SDP details:
Observations:
- The answer SDP contains only one
m-line
(m=application
for a data channel), which might not align with the offer SDP if it includes additional media types (e.g., audio or video). - This issue could be related to how
@livekit/react-native
or@livekit/react-native-webrtc
handles SDP negotiation on Android 13. - Note: While the error appears in development logs, it does not currently block functionality (e.g., joining and using the room). However, this has not been tested in a production environment, so potential impacts remain unknown.