swift-example icon indicating copy to clipboard operation
swift-example copied to clipboard

LiveKit dependency connection produces runtime error in project generated by Tuist

Open artemkrachulov opened this issue 1 year ago • 1 comments

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)

artemkrachulov avatar Aug 20 '23 14:08 artemkrachulov

Screenshot 2023-10-20 at 01 53 59

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

godra88 avatar Oct 19 '23 23:10 godra88