9
votes

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"

5
Hello @xojiang, were you able to find any solution? I'm facing the exact same issue!Sagar D

5 Answers

23
votes

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.

8
votes

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

7
votes

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.

4
votes

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.

0
votes

iOS 11 make sure your presentViewController is true this is false:

let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(Identifier : "VerificationsVC") Wrong
this is true: 
 let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier : "VerificationsVC")