This error is very weird.Everything is just fine yesterday.I install the Xcode 9 beta, and then I use Xcode 8 to run my app on iPhone 6p, iOS 9.3.2(I can do this yesterday, and I can still run the app on the simulator)then I get this error.
I Googled the error, it seems like no one runs into this error before.
Here is the error log:
Ld /Users/tianchi/Library/Developer/Xcode/DerivedData/GlobalDomain-dxjnqhelcuqfqkgiqyycgpwmzail/Build/Products/Debug-iphoneos/Global\ Domain.app/Global\ Domain normal arm64 cd /Users/tianchi/Desktop/ios/trunk export IPHONEOS_DEPLOYMENT_TARGET=8.0 export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk -L/Users/tianchi/Library/Developer/Xcode/DerivedData/GlobalDomain-dxjnqhelcuqfqkgiqyycgpwmzail/Build/Products/Debug-iphoneos -L/Users/tianchi/Desktop/ios/trunk/GlobalDomain -L/Users/tianchi/Desktop/ios/trunk/GlobalDomain/GDCommon/GDWeChatPay -L/Users/tianchi/Desktop/ios/trunk/GlobalDomain/GDCommon/ShareSDK/Support/PlatformSDK/WeChatSDK -L/Users/tianchi/Desktop/ios/trunk/GlobalDomain/GDCommon -L/Users/tianchi/Desktop/ios/trunk -F/Users/tianchi/Library/Developer/Xcode/DerivedData/GlobalDomain-dxjnqhelcuqfqkgiqyycgpwmzail/Build/Products/Debug-iphoneos -F/Users/tianchi/Desktop/ios/trunk/GlobalDomain/GDCommon/ShareSDK -F/Users/tianchi/Desktop/ios/trunk/GlobalDomain/GDCommon/ShareSDK/Support/Optional -F/Users/tianchi/Desktop/ios/trunk/GlobalDomain/GDCommon/ShareSDK/Support/PlatformSDK/QQSDK -F/Users/tianchi/Desktop/ios/trunk/GlobalDomain/GDCommon/ShareSDK/Support/Required -F/Users/tianchi/Desktop/ios/trunk/GlobalDomain/GDCommon/MobileAnalytics -F/Users/tianchi/Desktop/ios/trunk/GlobalDomain/GDCommon/GDAlipaySDK -F/Users/tianchi/Desktop/ios/trunk/GlobalDomain/GDCommon/TencentIM -F/Users/tianchi/Desktop/ios/trunk/GlobalDomain/GDCommon/UMeng -F/Users/tianchi/Desktop/ios/trunk/GlobalDomain/GDCommon/ShareSDK/Support/PlatformConnector -F/Users/tianchi/Desktop/ios/trunk/GlobalDomain/GDCommon -filelist /Users/tianchi/Library/Developer/Xcode/DerivedData/GlobalDomain-dxjnqhelcuqfqkgiqyycgpwmzail/Build/Intermediates/GlobalDomain.build/Debug-iphoneos/Global\ Domain.build/Objects-normal/arm64/Global\ Domain.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=8.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/tianchi/Library/Developer/Xcode/DerivedData/GlobalDomain-dxjnqhelcuqfqkgiqyycgpwmzail/Build/Intermediates/GlobalDomain.build/Debug-iphoneos/Global\ Domain.build/Objects-normal/arm64/Global\ Domain_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -ObjC -lAFNetworking -lCYLTabBarController -lFMDB -lIQKeyboardManager -lMBProgressHUD -lMJRefresh -lMasonry -lsqlite3 -framework CoreGraphics -framework Foundation -framework MobileCoreServices -framework Security -framework SystemConfiguration -framework UIKit -framework StoreKit -framework Security -lz -framework CoreTelephony -framework Crashlytics -framework SystemConfiguration -framework QuartzCore -framework CoreLocation -framework AdSupport -framework UMMobClick -lGDTMobSDK -lsqlite3 -framework JavaScriptCore -lstdc++ -framework TencentOpenAPI -licucore -lresolv -framework UserNotifications -framework UIKit -framework MOBFoundation -framework Foundation -framework CoreGraphics -framework CoreFoundation -framework CFNetwork -framework IMCore -framework ImSDK -framework IMSDKBugly -framework ShareSDKUI /Users/tianchi/Desktop/ios/trunk/GlobalDomain/GDCommon/jpush-ios-2.2.0.a -framework QALHttpSDK -framework WechatConnector -framework ShareSDK -framework QALSDK -framework QQConnector -framework TLSSDK -framework CoreMotion -framework CoreText -framework ShareSDKConnector -framework MessageUI -framework ImageIO -lWeChatSDK -framework Fabric -framework AlipaySDK -lWeChatSDK -framework ShareSDKExtension -lc++ -lPods -Xlinker -dependency_info -Xlinker /Users/tianchi/Library/Developer/Xcode/DerivedData/GlobalDomain-dxjnqhelcuqfqkgiqyycgpwmzail/Build/Intermediates/GlobalDomain.build/Debug-iphoneos/Global\ Domain.build/Objects-normal/arm64/Global\ Domain_dependency_info.dat -o /Users/tianchi/Library/Developer/Xcode/DerivedData/GlobalDomain-dxjnqhelcuqfqkgiqyycgpwmzail/Build/Products/Debug-iphoneos/Global\ Domain.app/Global\ Domain
ld: framework not found IOSurface for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Right click on your new Xcode9-Beta.app and select Show Package Contents
Then navigate to:
Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/
Then go to this same folder in the package contents of your Xcode8.app and paste the required framework(s) there.
After installing the Xcode9 Beta, you did very likely change your default Xcode with xcode-select -s ...
. That made the framework not found IOSurface for architecture arm64
error pop up when building with Xcode8.3.3 for me.
To fix this, I simply executed:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/
with /Applications/Xcode.app
being the Xcode8.x version.
Most likely you have previously built this project using Xcode 9 (beta, GM or the final release) and re-opened this same project on Xcode 8 and are now trying to build it again.
If you "Clean your build folder" (hold option and click on the Product menu on Xcode), you should be ready to do a fresh build on Xcode 8, without copying any frameworks from Xcode 9.
At least this worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With