livekit-examples / swift-example

Example app for LiveKit Swift SDK 👉 https://github.com/livekit/client-sdk-swift
https://livekit.io
Apache License 2.0
51 stars 16 forks source link

LiveKit dependency connection produces runtime error in project generated by Tuist #23

Open artemkrachulov opened 1 year ago

artemkrachulov commented 1 year ago

The original issue was posted on tuist issues, but maybe someone faced the same problems or had experience with it. Will be very appreciative to have help.

What happened?

LiveKit provides SwiftSDK for integration to the iOS applications. SwiftUI demo project works perfectly with SPM. My goal is to use the SwifUI demo in our project generated with Tuist.

I've created a new target and connected dependencies as I've done for all other targets (our app has many targets and dependencies, connection process was clear). As a demo, I use the same code from the demo project.

The application is launching without any issues. When LiveKit establishes a connection it crashes with “unrecognized selector sent to instance…” (check Error log section)

How do we reproduce it?

Tuist demo project : LiveKitTuist.zip

Download and gererate project with Tuist:

  1. cd LiveKitTuist
  2. tuist fetch
  3. tuist generate

To be sure, it's tusit generation issue I have same project with same structure with clean SPM: LiveKitXcode.zip

Download and open LiveKitXcode.xcodeproj

As demo credentials for both projects use:

url: wss://livekit.stg.globekeeper.com
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2OTI4MDAzMzUsImlzcyI6IldSazNUTnZUMjl3OTJRVmZjR0xIVEVsaHp0bGxnWUVlRmJSaXRrTSIsIm5hbWUiOiJ1c2VyMSIsIm5iZiI6MTY5MjcxMzkzNSwic3ViIjoidXNlcjEiLCJ2aWRlbyI6eyJyb29tIjoibXktZmlyc3Qtcm9vbSIsInJvb21Kb2luIjp0cnVlfX0.T1eEavbaVtd1ApskFV3U1pttpJE9fH6A6-cIi-7ooOg

PS: Token expires every 24 hours. I'm going to edit every day.

Error log

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[LiveKit.LocalParticipant addDelegate:]: unrecognized selector sent to instance 0x6000007a9810'

Screenshot 2023-08-18 at 11 48 08 AM

macOS version

13.5.1

Tuist version

3.17.0

Xcode version

Version 14.3.1 (14E300c)

godra88 commented 1 year ago

Screenshot 2023-10-20 at 01 53 59

Try this code put into settings, for me it resolve this same issue.