image not found while webrtc framework implement - ios

I am implement demo of WebRTC but i am referring below example for WebRTC i am getting error like below
dyld: Library not loaded: #rpath/libswiftCore.dylib
Referenced from: /private/var/containers/Bundle/Application/C9A9D890-946F-4045-9FB3-C1F05912F4E2/webrtc-socketio-ios.app/Frameworks/SocketIO.framework/SocketIO
Reason: image not found
Referral Link of Demo
https://github.com/digixtechnology/iOSRTC
i tried many solution with my research like below
Add framework in Embedded Binaries
Delete Derived Data
Change Run Path To $(inherited) #executable_path/Frameworks
but still i am getting crash and error Image Not Found so please some one help me to solve this

Comment use_frameworks! line in pod file, reinstall the libraries and it works.
Also check the paths of the frameworks included in your application under
Build Settings --> Search Paths --> Framework Search Paths
NOTE: Make sure to delete your build and then install again

Swift Package Manager Solution
In my case, I've added WebRTC via Swift Package Manager. And I've got the same exact error.
.package(url: "https://github.com/stasel/WebRTC.git", from: "93.0.0")
But, I've forgot to add under target dependencies. Here is my solution:
target(
name: "MyClientName",
dependencies: ["SomeOtherDependency", "**WebRTC**"]),
Best

Related

How to build Cocoa touch framework which use third party lib as cocoa pod?

I'm a iOS developer and want to build a distributed framework which use pods to integrate third party lib in framework project. Pods like SVProgressHUD and socket.io-client-swift.
I want to know what is the best way to build this kind of frameworks. Is there any tutorial given online which gives all the instructions.
I tried building a framework in above structure and it complies fine but when I'm importing this framework in other project getting errors:
dyld: Library not loaded: #rpath/Framework.framework/Framework
Referenced from:
/var/containers/Bundle/Application/73A8E170-4FE5-4CFF-B52E-C42099F32F9C/Framework.app/Framework
Reason: image not found
Can anyone help me. Thanks in Advance!
All you need to do is set the third party frameworks you are using for e.g:- socket.io-client-swift as Optional instead of Required under Link binary with Libraries in build Phases section. That's all. try it again and it will run as expected.

Embedded swift framework with cocoapods

I made a private framework that I want to use in different project. I use Cocoapods with this framework for third parties like AFNetworking, Facebook, or SDWebImage. I use an aggregate to build my framework for simulator and devices architectures.
I can build it, without any problem, but when I add my embedded framework to my new project (wrote in Objective-C), I have this error at the launch:
dyld: Library not loaded: #rpath/AFNetworking.framework/AFNetworking
Referenced from: /private/var/containers/Bundle/Application/2BE49976-94F8-43C3-BBFF-930F11642DDE/MyPhotoApp.app/Frameworks/PhotoLibrary.framework/PhotoLibrary
Reason: image not found
My new project has also Cocoapods with all the required pods of my framework.
The thing I would like, and I can't find how to do it, is to make a framework that depends of Cocoapods, but that does not contains the sources. I would like that the client add itself the necessary pods to its project.
Do you know how I can do that ?
Thank you :)
For Objective-c projects, DONOT uncomment the line use_frameworks!. It is meant only for swift projects. For future reference. :)

Xcode: create Framework with pod dependecies

I create a framework that use AFNetworking (installed with pod).
I can import this framework on my project and I can use all classes/methods that I exposed, so project compile.
When I try to run project on simulator, I obtain this error:
dyld: Library not loaded: #rpath/AFNetworking.framework/AFNetworking
Referenced from:
/Users/.../Library/Developer/CoreSimulator/Devices/F56F98F0-2AE0-4C87-AC9A-6E3B449762D1/data/Containers/Bundle/Application/BFA5359F-8FCE-4402-8487-CD9C002CB673/MyProject.app/Frameworks/MyFramework.framework/MyFramework
Reason: image not found
I already included 'MyFramework' under:
Build phases -> Embed Frameworks
I suppose I missing something on building Frameworks, but I can find out what! I already seen this unanswered question.
Who can I use MyFramework without installing Pod on MyProject again?
It is really delayed, for this issue but I have got my project working. It might not be the best way but it works. I am putting it here for future reference.
I wanted to do it without using Pods in the main project. The reasoning is, we are bundling our SDK into a framework.
So essentially, the first step I took was to get the framework project bundling without using the workspace. I just dragged the Pods project into the framework project.
Then I added the frameworks the the pods project creates and add them to my framework. I set them to optional and code sign. You can see them in the picture of where I added them under the build phases.
Then add them to your main project. not the framework the normal way by adding the project and or the framework. Then add it to the Embedded binaries and Linked Frameworks.
If it helps anyone, the solution mentioned by #ArtyomDevyatov does work. The trick is that you have to add 's.dependency' in podspec file.

dyld: Library not loaded: #rpath with iOS8

I'm creating an iOS framework with Xcode6 and iOS8. When I link this with an iOS app and try running it on the device I get this error
dyld: Library not loaded: #rpath/FrameworkName.framework/FrameworkName
Referenced from: /private/var/mobile/Containers/Bundle/Application/0F2C2461-A68B-4ABA-A604-B88E6E9D1BB1/AppName.app/AppName
Reason: image not found
The 'Runpath Search Paths' build setting for the framework is set by default to
'#executable_path/Frameworks', '#loader_path/Frameworks'
I could not find any documentation related to this. This was something new introduced with Xcode6 and I would expect it to just work by simply including the framework into any app that needs it.
To make this work
In the framework project settings change the install directory from
'/Library/Frameworks' to '#executable_path/../Frameworks'
In the project that includes this framework, add a copy files phase and copy this framework to the 'Frameworks' folder. Once you do this ensure that this framework is listed under the 'Embedded Binaries' section.
Issue resolved using this answer. According to #vladof81:
In the target's General tab, there is an Embedded Binaries field. When you add the framework there the crash is resolved.
Reference is here on Apple Developer Forums.
I also had same kind of problem where I was not able to launch the app & app was crashing with above message :
dyld: Library not loaded: #rpath/FrameworkName.framework/FrameworkName Referenced from: /private/var/mobile/Containers/Bundle/Application/xxxxxxxxxxxxxxxxxxx
Reason: image not found
Here is my approach that helped me to resolve this error:
From General Tab
Frameworks, Libraries, and Embedded Content
add the framework and make sure to make it Embed & Sign
From Build Phases
Dependences
add the framework to it
Check if you can find framework in context under :
Build Phases > Embed Frameworks >
If not just add that framework in "Embed Frameworks" after adding that framework in your project directory's "Frameworks" section.
I was getting this error on a library installed through CocoaPods. Cleaning the build folder (cmd + option + shift + k) and then doing a clean (cmd + shift + k) was what ended up resolving this issue for me.
If you are using Carthage
Run carthage update on terminal
Go to Project Settings -> Build Phases -> Carthage Copy Frameworks
Add line in Inputs files:
$(SRCROOT)/Carthage/Build/iOS/YOURLIBRARY.framework
Add this line to Output files:
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/YOURLIBRARY.framework
For me it was because of the SSL issue, I had set my developer, distribution certificates on my Mac(Keychain) to 'Always Trust' for one of my other project. I had to change them back to 'Use System Defaults'. it was working for me then!!
Made the library which shows not loaded changed from required to optional in Linked binaries and frameworks. It is working perfectly now
I also had same kind of problem where I was not able to launch the app & app was crashing with above message :
dyld: Library not loaded: #rpath/FrameworkName.framework/FrameworkName
Referenced from: /private/var/mobile/Containers/Bundle/Application/xxxxxxxxxxxxxxxxxxx
Reason: image not found
Here is my approach that helped me to resolve this error:
1.Please delete your app from device, Clean the build and and rebuild and run on the device.
2.If above steps does not help you, then please check for below settings :
From "TARGET">"Build Settings">"Runpath Search Paths" & then check for values "$(inherited)" & "#executable_path/Frameworks", Feel free to add incase they don't exist.
Build your app and run it on device
In addition to the above solutions, recheck the paths of frameworks included in your application under
Build Settings --> Search Paths --> Framework Search Paths
When non of those solution works:
(Optional) Get a clear knowledge from here on different search path type
Make sure that your .framework file paths are added in Build Settings -> Framework Search Paths. You can keep all framework files somewhere in App/libs/ and add this folder and enable recursively.
Make sure that your .a files paths are added in Build Settings -> Library Search Paths.
I installed third party libraries using Cocoapods. Got the same error, tried everything but finally realised I havent had use_frameworks! in my pod file.
So removed the currently installed library, added use_frameworks! line in pod file, reinstalled the libraries and all worked for me.
The way tested by me is well.
In "Linked Binary With Libraries" change the missing framework to "Embedded Framework".
Because, "Do not Embedded" do not copy to the App, but Embedded Framework will copy into it.

dyld issues library not loaded

When I have tried to build my target I get this error with dynamic linker:
dyld: Library not loaded: #rpath/iPhoneSimulatorRemoteClient.framework/Versions/A/iPhoneSimulatorRemoteClient
I use this iphonesim library link that referenced on path as above.
I use Xcode 4.3 and in this case I think the path wrong.
How to change this path to correct path?
I have download this library again and recompile it.
I think this is related due XCode 4.3 have another path for framework.
Please check this link link

Resources