Program run on iOS 5.1 device can't find SDK w

2019-04-26 16:28发布

问题:

When i run my project at iOS 5.1 simulator , it shows

yld: lazy symbol binding failed: Symbol not found: _objc_setProperty_nonatomic_copy
  Referenced from: /Users/apple/Library/Application Support/iPhone Simulator/5.1/Applications/3A003E5F-2C66-494F-BCC1-C3EE82F01464/dogTree.app/dogTree
  Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/Foundation.framework/Foundation

And I don't have 5.1 SDK. But why library search path is 5.1 not 6.0?

All my project and be run at iOS 6.0 device, but when I install then at iOS 5.0 or 5.1 device, it crash and show like the following message.

Please give me some help, is it necessary for iOS 5.1 SDK to run iPhone 5.1 simulator?

回答1:

I had the same problem and found that I had simply forgotten to change the target platform in an included project. Xcode automatically switches target to the latest iOS when upgrading. Just changing the target for the included project fixed this.



回答2:

I have met similar issue, and solved by set the deployment target to 4.3 (the same as my app's minimum version) for each static library depended on.
I found that the static library depended on was 6.0 as default, and that must cause some library missing when the compatibility was needed for lower version.



回答3:

For libraries, such as pods, its in the build settings at iOS Deployment Target.



标签: xcode build ios6