livekit / client-sdk-flutter

Flutter Client SDK for LiveKit

Home Page:https://docs.livekit.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flutter: Could not connect LiveKit Exception: [ConnectException] Timed out waiting for EnginePeerStateUpdatedEvent

rishu2004 opened this issue · comments

Describe the bug

To Reproduce

Expected behavior

show in window
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.10.6, on Microsoft Windows [Version 10.0.19045.3570], locale en-IN)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.8.1)
[√] Android Studio (version 3.6)
[!] Android Studio (version 2021.2)
X Unable to determine bundled Java version.
[√] Android Studio (version 2022.2)
[√] VS Code (version 1.84.2)
[√] Connected device (3 available)
[√] Network resources

  • Flutter version: 3.10.6
  • Plugin version: livekit_client: ^1.2.1
  • Flutter console log:(flutter: Could not connect LiveKit Exception: [ConnectException] Timed out waiting for EnginePeerStateUpdatedEvent)
    image

This is not a code bug, the reason is that the ICE connection fails, I think we need to throw a dedicated exception when EnginePeerStateUpdatedEvent fails, for example, ICE ConnectionFailed (please check the server deployment or enable turn server)

But this error comes on desktop every time I connect the room and only desktop.

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: LiveKit Exception: [ConnectException] Timed out waiting for EnginePeerStateUpdatedEvent
#0 Engine.connect. (package:livekit_client/src/core/engine.dart:168:26)
#1 _RootZone.run (dart:async/zone.dart:1655:54)
#2 Future.timeout. (dart:async/future_impl.dart:942:34)
#3 Timer._createTimer. (dart:async-patch/timer_patch.dart:18:15)
#4 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
#5 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
#6 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

When encountering this failure, it means that ICE cannot connect normally. Please use the following test page to verify the server connection.

https://livekit.io/connection-test

This exception has been renamed MediaConnectException
#422