Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdpSemantics property not found crash #155

Closed
leeqiangzi opened this issue Oct 27, 2022 · 27 comments
Closed

sdpSemantics property not found crash #155

leeqiangzi opened this issue Oct 27, 2022 · 27 comments

Comments

@leeqiangzi
Copy link

leeqiangzi commented Oct 27, 2022

-[RTCConfiguration setSdpSemantics:]: unrecognized selector sent to instance 0x281ffc960

Specific location:

    public static func liveKitDefault() -> RTCConfiguration {

        let result = DispatchQueue.webRTC.sync { RTCConfiguration() }
        result.sdpSemantics = .unifiedPlan
        result.continualGatheringPolicy = .gatherContinually
        result.candidateNetworkPolicy = .all
        result.tcpCandidatePolicy = .enabled
        result.iceTransportPolicy = .all

        result.iceServers = [ DispatchQueue.webRTC.sync { RTCIceServer(urlStrings: defaultIceServers) } ]

        return result
    }

‘DispatchQueue.webRTC.sync { RTCConfiguration() }',
No crash caused by sdpSemantics exists in the returned object;Is there any solution?,Call de exactly according to the document。

Thank you.

@davidzhao
Copy link
Member

hi, which version are you running on? can you provide any repro steps?

@leeqiangzi
Copy link
Author

The latest pod 1.0.6 updated yesterday

@leeqiangzi
Copy link
Author

leeqiangzi commented Oct 27, 2022

@objc class KSLiveKitManager: NSObject {
    override init() {
        super.init();
    }
    
    lazy var room = Room(delegate: self)
    
    /// 链接
    @objc
    func connect(url: String, token: String) {
        room.connect(url, token);
    }
    
    /// 离开房间,断开链接
    @objc
    func disconnect() {
        room.disconnect();
    }
}

extension KSLiveKitManager: RoomDelegate {

    func room(_ room: Room, localParticipant: LocalParticipant, didPublish publication: LocalTrackPublication) {
        
    }
    
    func room(_ room: Room, participant: RemoteParticipant, didSubscribe publication: RemoteTrackPublication, track: Track) {

    }
}

@leeqiangzi
Copy link
Author

We are very anxious. We hope you can repair it as soon as possible. Thank you

@leeqiangzi
Copy link
Author

pod 'LiveKitClient', '1.0.6'

@leeqiangzi
Copy link
Author

Can you find the problem from the information I provided?

@hiroshihorie
Copy link
Member

I'm investigating this, it might be Cocoapods related.
Can you give me the steps to replicate this ?

@leeqiangzi
Copy link
Author

leeqiangzi commented Oct 27, 2022

  1. Use cocopods to manage, pod 'LiveKitClient', '1.0.6'
  2. This problem will occur if you link directly with url and token
  3. The specific tool code is as follows
@objc class KSLiveKitManager: NSObject {
    override init() {
        super.init();
    }
    
    lazy var room = Room(delegate: self)
    
    /// 链接
    @objc
    func connect(url: String, token: String) {
        room.connect(url, token);
    }
    
    /// 离开房间,断开链接
    @objc
    func disconnect() {
        room.disconnect();
    }
}
[self.liveManager connectWithUrl:kKSLiveKitUrl token:token];

The error is reported directly in the sdk

@leeqiangzi
Copy link
Author

The main problem is why there is no sdpSemantics in the RTCConfiguration returned by the webRTC, leading to a crash when assigning values. We did nothing outside, which means we called the link

@leeqiangzi
Copy link
Author

Hello, do you have any progress?

@leeqiangzi
Copy link
Author

2222222
21212121

@hiroshihorie
Copy link
Member

Are you using the ObjC version ?

@leeqiangzi
Copy link
Author

ObjC or swift have problems

@leeqiangzi
Copy link
Author

What I'm using now is to create a swfit class that calls livekit, and then calls swift with ObjC

@leeqiangzi
Copy link
Author

I really don't understand what's going on. I've been looking forward to your reply

@leeqiangzi
Copy link
Author

My code is ObjC, but you use Cocopods integration 1.0.6 to integrate, and use the bridge file to call swift

@hiroshihorie
Copy link
Member

I can't reproduce this at the moment.

@leeqiangzi
Copy link
Author

I will provide you with a Github demo later, about

@hiroshihorie
Copy link
Member

Can I see your Podfile.lock file ?

@leeqiangzi
Copy link
Author

leeqiangzi commented Oct 27, 2022

  • LiveKitClient (1.0.6):
    • Logging
    • PromisesSwift
    • SwiftProtobuf
    • WebRTC-SDK (~> 104.5112.05)
  • Logging (1.4.0)
  • Masonry (1.1.0)
  • MBProgressHUD (1.1.0)
  • MJExtension (3.2.2)
  • MJRefresh (3.5.0)
  • NTESVerifyCode (3.4.2)
  • OpenSSL-TEG (1.0.0)
  • PromisesObjC (2.1.1)
  • PromisesSwift (2.1.1):
    • PromisesObjC (= 2.1.1)
  • Protobuf (3.19.1)

@hiroshihorie
Copy link
Member

Looks correct.... can you prepare a small demo ? thanks.

@leeqiangzi
Copy link
Author

Hello, first of all, thank you very much for your reply. The reason for the problem has been found. It is because one of the other static libraries (. a) in our project references a lower version of webrtc. The 'RTCConfiguration' class in this version does not define the 'sdpSemantics' attribute
I also want to ask you whether we can still use LiveKit if a low version of WebRtc exists in the project and cannot be modified. Do you have a solution here

@leeqiangzi
Copy link
Author

LiveKit is very important to us. Another library that references low version WebRtc is also important to us, but they can't modify it. We use LiveKit only for voice calls, and 'url' and 'token' are connected. Is there a better way to use LiveKit? For example, low version WebRtc is used in low version livekits, but only version 1.0.6 is seen in the current pod management

@leeqiangzi
Copy link
Author

The lower version is probably the 2016 version of webrtc

@hiroshihorie
Copy link
Member

hiroshihorie commented Oct 30, 2022

Oh ok that makes a lot of sense it would crash.

You can fork this repo and reference your preferred WebRTC version and comment out the sdpSemantics property.

I'll close this for now since it's specific for your use case but I'm willing to continue support.

@hiroshihorie hiroshihorie changed the title Urgent Crash sdpSemantics property not found crash Oct 30, 2022
@leeqiangzi
Copy link
Author

Hello, I'd like to ask, what is the minimum version of livekit supported on pod? At present, there is only one 1.0.6

@hiroshihorie
Copy link
Member

@leeqiangzi I think you can use previous versions .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants