ios - 错误编译 alamofire - : -Xlinker 中的未知选项字符 `X'

标签 ios iphone swift alamofire

尝试将 alamofire 添加到使用 cocoapods 的项目中。 Xcode版本:版本6.1.1 (6A2008a)

播客文件:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

pod 'OAuth.io'
pod 'Alamofire', '~> 1.1'

这是错误:

Libtool /Users/tony/Library/Developer/Xcode/DerivedData/Candytone-aynufizixrzmtwgatrvrjynlonxv/Build/Products/Debug-iphonesimulator/libPods-Alamofire.a normal x86_64
    cd /Users/tony/src/candytone-ios/Candytone/Pods
    export IPHONEOS_DEPLOYMENT_TARGET=8.1
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk -L/Users/tony/Library/Developer/Xcode/DerivedData/Candytone-aynufizixrzmtwgatrvrjynlonxv/Build/Products/Debug-iphonesimulator -filelist /Users/tony/Library/Developer/Xcode/DerivedData/Candytone-aynufizixrzmtwgatrvrjynlonxv/Build/Intermediates/Pods.build/Debug-iphonesimulator/Pods-Alamofire.build/Objects-normal/x86_64/Pods-Alamofire.LinkFileList -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/tony/Library/Developer/Xcode/DerivedData/Candytone-aynufizixrzmtwgatrvrjynlonxv/Build/Intermediates/Pods.build/Debug-iphonesimulator/Pods-Alamofire.build/Objects-normal/x86_64/Pods_Alamofire.swiftmodule -framework Foundation -o /Users/tony/Library/Developer/Xcode/DerivedData/Candytone-aynufizixrzmtwgatrvrjynlonxv/Build/Products/Debug-iphonesimulator/libPods-Alamofire.a

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `X' in: -Xlinker
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]

最佳答案

通过升级到 Cocoapods 0.36beta 解决了这个问题。

gem install cocoapods --pre

我还必须删除旧版本。

gem uninstall cocoapods

关于ios - 错误编译 alamofire - : -Xlinker 中的未知选项字符 `X',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28248014/

相关文章:

iphone - iPhone-在核心数据上获取数据

ios - Swift 早期函数​​在没有防护的情况下退出 Swift

iphone - 上传或导出大视频会占用内存并导致崩溃...我该如何分解它?

ios - 如何在谷歌地图 iOS 上放置一个文本字段

ios - Xcode 关闭后找不到框架

iphone - - (void)add<名称>对象 : function

ios - 拍摄circle IOS的​​屏幕截图

ios - 如何使用主窗口不旋转但其余窗口旋转的单 View 应用程序模板创建应用程序?

ios - NSString *最新版本字符串

ios - 返回文本或按钮的 Swiftui 函数?