stasel / WebRTC

Unofficial distribution of up to date WebRTC framework binaries for iOS and macOS
Other
359 stars 76 forks source link

Library not loaded: @rpath/WebRTC.framework/WebRTC #39

Open Nahatakyan opened 2 years ago

Nahatakyan commented 2 years ago

Hi. I am trying to install a manually downloaded WebRTC. I create an empty project, add xcframework to my Frameworks, Libraries, and Embedded content and just run the empty project. I am getting these errors:

dyld[3164]: Library not loaded: @rpath/WebRTC.framework/WebRTC
  Referenced from: /private/var/containers/Bundle/Application/D226FD5F-C2E7-432E-A62C-8E8B2EC6EA7E/WebRTCTest.app/WebRTC dynamic test
  Reason: tried: '/private/var/containers/Bundle/Application/D226FD5F-C2E7-432E-A62C-8E8B2EC6EA7E/WebRTCTest.app/Frameworks/WebRTC.framework/WebRTC' (no such file), '/private/var/containers/Bundle/Application/D226FD5F-C2E7-432E-A62C-8E8B2EC6EA7E/WebRTCTest.app/Frameworks/WebRTC.framework/WebRTC' (no such file), '/System/Library/Frameworks/WebRTC.framework/WebRTC' (no such file)
Library not loaded: @rpath/WebRTC.framework/WebRTC
  Referenced from: /private/var/containers/Bundle/Application/D226FD5F-C2E7-432E-A62C-8E8B2EC6EA7E/WebRTCTest.app/WebRTCTest
  Reason: tried: '/private/var/containers/Bundle/Application/D226FD5F-C2E7-432E-A62C-8E8B2EC6EA7E/WebRTCTest.app/Frameworks/WebRTC.framework/WebRTC' (no such file), '/private/var/containers/Bundle/Application/D226FD5F-C2E7-432E-A62C-8E8B2EC6EA7E/WebRTCTest.app/Frameworks/WebRTC.framework/WebRTC' (no such file), '/System/Library/Frameworks/WebRTC.framework/WebRTC' (no such file)

Do I need to do something else that's not written in the instructions?

Screen Shot 2022-06-14 at 12 28 17

Update. I changed to Embed and sign, and the project works, but when I try to add WebRTC.framework to my framework and it does not work. The same issue

stasel commented 2 years ago

For me it works with a new iOS project. Can you share your environment? You should consider using SPM as well for easier integration

Shishani58 commented 1 year ago

@stasel I have the same issue, but I didn't install manually. You can check the bug in this demo project: https://github.com/Shishani58/WebRTC-bug-demo

With a structure: Swift Package with WebRTC in framework Target, you will get an error: Library not loaded. It might be an SPM bug, but I haven't been able to resolve it.

stasel commented 1 year ago

Hey @Shishani58 Not sure what is the purpose of the wrapper local package but it seems to cause the issue. If you directly reference the WebRTC-Package in your project it works with no issues on Xcode 13.4.1

CyonAlexRDX commented 1 year ago

@Nahatakyan @Shishani58 do you have an Apple M1, the issue has been fixed in #61 (but our Intel colleague did not have the issue, only M1s)

Nahatakyan commented 1 year ago

Yes, my MacBook on M1 pro

stasel commented 1 year ago

Thanks everyone for reporting and thanks to @GhenadieVP for the fix. I have release a minor patch 109.0.1 with the fix. Can anyone please confirm that the latest release fixes the issue?

Thanks!

bmp123 commented 1 year ago

@stasel Hello! I add webrtc.framework to my framework by SPM and have same issue. v109.0.1

CyonAlexRDX commented 1 year ago

@stasel Hello! I add webrtc.framework to my framework by SPM and have same issue. v109.0.1

Can you share your Package.swift? Or are you consuming Stasel/WebRTC directly from an app target?

Do you make sure to delete: derived data .build (if SPM) Clear SPM Package caches (Xcode -> File -> Packages -> Clear Cache And try again?

Is it an iOS target or macOS target you are using?

bmp123 commented 1 year ago

@stasel @CyonAlexRDX Yes, I consuming from an app target. Yes I cleared all of this Error only when real iOS device target. For Mac all good

bmp123 commented 1 year ago

Is it a bug or I doing something wrong?

stasel commented 1 year ago

@bmp123 can you try to reproduce the issue in a demo empty project and share it here?

bmp123 commented 1 year ago

@stasel Yes I can. https://github.com/bmp123/demo_webrtc_lib_issue

Снимок экрана 2023-02-02 в 10 04 33
stasel commented 1 year ago

It compiles on my Xcode 14.2: image

bmp123 commented 1 year ago

@stasel It’s compiled but if you add this framework into some app and start them - you get an error “library not found”

bmp123 commented 1 year ago

@stasel open Demo.swift, you not see error like in screenshot?

@stasel Yes I can. https://github.com/bmp123/demo_webrtc_lib_issue

Снимок экрана 2023-02-02 в 10 04 33
GhenadieVP commented 1 year ago

@bmp123 Just by cloning your repo, indeed I got the same error as you. But removing and adding the WebRTC package again - fixed the issue for me.