Skip to content

[Bug] WebRTC Connection Fails: SDP m-lines Order Mismatch in @livekit/react-native #224

Closed
@franco820711

Description

@franco820711

[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:

  1. Set up a WebRTC peer connection using @livekit/react-native and @livekit/react-native-webrtc.
  2. Join a room (e.g., room-452a6def) with a participant (e.g., test).
  3. Attempt to set the remote answer SDP received from the server.
  4. 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

Image

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions