dyld: Library not loaded: Reason: image not found - ios

I know there is plenty of topics on this issue, to be honest, I think I have read all of them in the past 3 days, but none of them help me to solve my issue.
I have to build an iOS app implementing a custom framework, build by my own.
When I want to run my app on a real device, here is what I get (XXX is replaced for confidentiality of course) :
dyld: Library not loaded: #rpath/libswiftCore.dylib
Referenced from: /private/var/containers/Bundle/Application/0FCB15D6-B961-47A6-96A1-2CA896634277/XXX.app/Frameworks/XXX.framework/XXX
Reason: image not found
Following all topics, I tried to put the framework in the embedded binaries and stuff, but nothing worked...
If someone has another idea...I'll take it !

I finally found a solution.
The framework was build with an older version of xCode (8.2), so I downgraded my project in xCode 8.2, and the issue vanished...not sure this is the best way to resolve it, but it works.

Related

Library not loaded: #rpath/GoogleToolboxForMac.framework/GoogleToolboxForMac

I try the answers in StackOverFlow to fix my problem. But no one works for me.
I run my app and build successful everytime, but sometimes crash to print the crash log and sometimes launch my app successfully.
I don't know why to make two of situation.
Crash Log:
dyld: Library not loaded: #rpath/GoogleToolboxForMac.framework/GoogleToolboxForMac
Referenced from: /Users/XXX/Library/Developer/CoreSimulator/Devices/8FB6E110-F30F-425D-9011-A196E78BE7CB/data/Containers/Bundle/Application/3C10C9A5-9012-4444-B7CF-D0615DED602A/XXXXXXXXXXXXX.app/XXXXXXXXXXXXX
Reason: image not found
This is my Linked Frameworks and Libraries, and why my GoogleToolboxForMac.framework turns light gray color.
I also try pod install again, and not work.
How to fix my crash problem?

dylib missing on iOS application

I am trying to port a program made using OpenCV 2.4 (not 3) from OSX to iOS 7 (not 8, or 9)
I followed their tutorial, that worked until it complained of jpeg linking errors, I pasted the errors on google, and found on their issue tracker a solution, and a link to the jpeg library, I downloaded it, did all the steps correctly, and now it compiles and runs, but crashes on startup and complains with the following error:
dyld: Library not loaded: /opt/libjpeg-turbo/lib/libjpeg.62.dylib
Reason: image not found
I have no idea how to fix it
Go to your Project -> Target -> General -> Linked Frameworks and Libraries and try changing the status of the libjpeg.a library you linked to "Optional" instead of "Required".
I was having the same exact issue and changing the status fixed the crash for me. Not sure why.

dyld: Library not loaded: #rpath/libswiftCore.dylib - Error in Xcode 7

I was working on Xcode 7 beta with Swift in a Mac mini (running Yosemite) Due to poor performance i installed Yosemite on my PC (like Hackintosh). And i copied the "xcode 7 beta.app" from 'applications' folder to my new pc's Yosemite.
Note: This question is already asked in stack overflow. But none of the solutions worked for me.
When i try to run the app in to my iPad i got an error like this. But no problem while running in emulator
dyld: Library not loaded: #rpath/libswiftCore.dylib
Referenced from: /var/mobile/Containers/Bundle/Application/80F87502-B264-4BF3-8200-4B9A69C99189/Hi Gijo.app/Hi Gijo
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/80F87502-B264-4BF3-8200-4B9A69C99189/Hi Gijo.app/Frameworks/libswiftCore.dylib: mmap() errno=1 validating first page of '/private/var/mobile/Containers/Bundle/Application/80F87502-B264-4BF3-8200-4B9A69C99189/Hi Gijo.app/Frameworks/libswiftCore.dylib'
(lldb)
I searched a lot and find to method to fix it. But none of them worked for me.
'Embedded content contains swift code' = Yes.
adding '#executable_path/Frameworks' to runpath.
Can someone pls tell me how can i fix this? Will reinstalling Yosemite/Xcode fix this? (I only have the .app file of xcode) Is there any other solution?
The issue is solved. I downloaded the new xcode 7 gm speed .dmg file from apple beta developers and installed. Now everything works fine

Why Pods.framework has to be optional? And why does that work?

I have a project mainly in Swift that has dependencies managed by CocoaPods. At a given point in time I decided to change Pods.framework link status to required, instead of optional.
Running with this configuration works fine on the simulator, but if I try to run it on the iPhone, I get the following crash at the startup:
dyld: Library not loaded: #rpath/Pods.framework/Pods
Referenced from: /private/var/mobile/Containers/Bundle/Application/...
Reason: image not found
Now if I just change it back to optional, it works fine. I have found this solution on Github. But I still don't get it, even after reading Apple's documentation.
Why does it work like this?

dyld isuess (Library not loaded)

I have this message when I build my project:
dyld: Library not loaded:
#rpath/iPhoneSimulatorRemoteClient.framework/Versions/A/iPhoneSimulatorRemoteClient
Referenced from: /Users/dev01/mobile/ios/Test/test/testTests/FoneMonkey/bin/iphonesim
Reason: image not found
This is dynamic link error and as I understand correct this error came because image not found. is this correct?
What steps should be taken to resolve errors?
I have found this link and as I understad this error came because I use xcode 4.3. Now I have try this on 4.2 and everething work good.
But I not have any idea how to run it on XCode 4.3
Maybe you have this problem after adding new library and you linked it in actual framework path, if you drag this library in embeded framework path then problem will solve. Another variant is that in build scheme you have enabled memory managment malloc, if you turn it off problem will be solved.
Check your SDK project settings (i.e. when passing from SDK 6.x to 7.x) maybe one of library was not compiled for architecture and project target. And the paths. Clean DerivedData and delete app from simulator (if it is there).
If you still need the Sdk just copy it from Xcode 4.6.(3) both for device and simulator and see if this solve your problem.

Resources