dyld: Symbol not found: error how to resolve this issue

时光毁灭记忆、已成空白 提交于 2019-11-27 09:18:28

dyld errors are caused by a missing or a bad library linking, not code.

Double check your frameworks links, do not hesitate to delete/recreate the links, taking care of iOS version you are taking your frameworks from. (usually use the Xcode provided list, do not browse for files)

In your case I won't be surprised that linking /System/Library/Frameworks/Security.framework is an error, since it doesnt look like belonging to iOS SDK, looking at its path...

Which I guess should be instead something like: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator<Version>.sdk/System/Library/Frameworks/Security.framework

kapsalot

ugh. i hit this too. turned out that i had accidentally checked the box to copy the framework to my local dir when adding the framework to my project.

delete the framework from your project.

then add the framework making sure to not copy the files.

This also happens when you are referencing a library, variable or method that is not compiled in the current OS that you are targeting.

So check the symbol and see if it is available. For example, CFRelease(CFTypeRef cf) is available in all iOS frameworks, but CFAutorelease(CFTypeRef arg) is only available in iOS 7.0 (and Mac OSX 10.9) and above designated by CF_AVAILABLE(10_9, 7_0)

I got the same error when I changed the suffix that my executable uses when loading frameworks from 'no' suffix to 'debug' suffix. I think the debug frameworks aren't being kept up to date by Apple.

You might get bit this way if you are using 'debug' for other reasons, then add a framework whose debug version isn't up to date.

As at XCode 3, the suffix setting is available in the "General" pane of your executable's "Get Info" window.

I have had this problem also and it seems to be a known bug in the CFNetwork in iOS 8 SDK (look here: https://devforums.apple.com/message/971238#971238).

The work around is as follows:

Change the link order in "Link Binary With Libraries" of your target and put Foundation.framework before CFNetwork.framework.

That solved the issues for me.

Change your deployment target to iOS 8.1.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!