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

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

Open
Nahatakyan opened this issue Jun 14, 2022 · 16 comments
Open

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

Nahatakyan opened this issue Jun 14, 2022 · 16 comments

Comments

@Nahatakyan
Copy link

Nahatakyan commented Jun 14, 2022

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
Copy link
Owner

stasel commented Jun 22, 2022

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
Copy link

Shishani58 commented Jul 8, 2022

@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
Copy link
Owner

stasel commented Jul 8, 2022

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
Copy link

@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
Copy link
Author

Yes, my MacBook on M1 pro

@stasel
Copy link
Owner

stasel commented Jan 17, 2023

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
Copy link

bmp123 commented Jan 30, 2023

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

@CyonAlexRDX
Copy link

@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
Copy link

bmp123 commented Jan 30, 2023

@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
Copy link

bmp123 commented Feb 1, 2023

Is it a bug or I doing something wrong?

@stasel
Copy link
Owner

stasel commented Feb 1, 2023

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

@bmp123
Copy link

bmp123 commented Feb 2, 2023

@stasel
Copy link
Owner

stasel commented Feb 4, 2023

It compiles on my Xcode 14.2:
image

@bmp123
Copy link

bmp123 commented Feb 4, 2023

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

@bmp123
Copy link

bmp123 commented Feb 4, 2023

@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
Copy link
Contributor

@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.

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

6 participants