Build error on Xcode 8.1
I use cocoapods and Xcode 8.1. My pod file: pod 'Socket.IO-Client-Swift', '~> 8.0.2'
When I build my project, error was:
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
Then I follow the instruction and Convert to Current Swift Syntax, then build again, now error was:
ld: warning: Auto-Linking supplied '/Users/xiaoming/Library/Developer/Xcode/DerivedData/Chatchat-cbljmmhhqfbdjoeqrkgtasbkniad/Build/Products/Debug-iphoneos/Socket.IO-Client-Swift/SocketIOClientSwift.framework/SocketIOClientSwift', file was built for arm64 which is not the architecture being linked (armv7): /Users/xiaoming/Library/Developer/Xcode/DerivedData/Chatchat-cbljmmhhqfbdjoeqrkgtasbkniad/Build/Products/Debug-iphoneos/Socket.IO-Client-Swift/SocketIOClientSwift.framework/SocketIOClientSwift Undefined symbols for architecture armv7: "OBJC_CLASS$__TtC19SocketIOClientSwift14SocketIOClient", referenced from: objc-class-ref in ContactsTableViewController.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)
More Information:
When a iPhone 6Plus is connected to my Mac, the building will succeed, but will crash upon launch:
dyld: Library not loaded: @rpath/SocketIOClientSwift.framework/SocketIOClientSwift Referenced from: /var/containers/Bundle/Application/0398A438-1B83-4F89-AA83-EDFE6E38C4EF/Chatchat.app/Chatchat Reason: image not found
When a iPhone 5c is connected to my Mac, the building will fail with errors above:
ld: warning: Auto-Linking supplied '/Users/xiaoming/Library/Developer/Xcode/DerivedData/Chatchat-cbljmmhhqfbdjoeqrkgtasbkniad/Build/Products/Debug-iphoneos/Socket.IO-Client-Swift/SocketIOClientSwift.framework/SocketIOClientSwift', file was built for arm64 which is not the architecture being linked (armv7): /Users/xiaoming/Library/Developer/Xcode/DerivedData/Chatchat-cbljmmhhqfbdjoeqrkgtasbkniad/Build/Products/Debug-iphoneos/Socket.IO-Client-Swift/SocketIOClientSwift.framework/SocketIOClientSwift Undefined symbols for architecture armv7: "OBJC_CLASS$__TtC19SocketIOClientSwift14SocketIOClient", referenced from: objc-class-ref in ContactsTableViewController.o ld: symbol(s) not found for architecture armv7
Sorry about this issue, seems there is API changes from older versions , these errors no longer exist after I adapt to new APIs.
@TaoistKing Getting the same Error.