Xcode 8, iOS 8 simulator with crash: “dyld: lazy symbol binding failed: Symbol not found: _objc_unsafeClaimAutoreleasedReturnValue”

对着背影说爱祢 提交于 2019-12-23 08:59:07

问题


Update to Xcode 8, run my app in iOS 8 simulator with crash though iOS9 and iOS10 no problem.

"dyld: lazy symbol binding failed: Symbol not found: _objc_unsafeClaimAutoreleasedReturnValue Referenced from: ** Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc.A.dylib

dyld: Symbol not found: _objc_unsafeClaimAutoreleasedReturnValue
Referenced from: ** Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc.A.dylib"


回答1:


If you have any sub-projects under the main project, one of the reasons this may happen is one or more sub-projects have their “Deployment Target” higher than the main project.

For example, if your main project has its deployment target 8.0, set the deployment targets of all the sub-projects to 8.0. I think this will fix your problem. Let me know in case it does. Cheers.




回答2:


I had the exactly same problem after upgrading to Xcode 8, and as @Shaggy pointed out, in my case it is caused by deployment targets in dependent projects being set to 9.3 while my main project has a deployment target of 8.0.

To add more, it may be useful to look at the stack trace leading to the crash to pinpoint the project, especially when you have many dependent projects. In my case, I found certain functions are called from a dependent library project, and it is indeed that particular project causing the issue.




回答3:


I had the same issue after changing function arguments in a downloaded library. Cleaning the build directory did it for me.




回答4:


I had this while building a custom CocoaPod. The pod I was building had Swift version 5, while the example project was on Swift version 4. I had to bump up 4 to 5 in order to get rid of this crash.



来源:https://stackoverflow.com/questions/39486064/xcode-8-ios-8-simulator-with-crash-dyld-lazy-symbol-binding-failed-symbol-n

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