2015-01-31 13 views
7

Cố gắng thêm alamofire vào một dự án sử dụng cocoapod. Xcode phiên bản: Phiên bản 6.1.1 (6A2008a)alamofire biên dịch lỗi - ký tự tùy chọn không xác định `X 'trong: -Xlinker

Podfile:

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

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

Dưới đây là các lỗi:

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] 
+0

theo câu hỏi này: http://stackoverflow.com/questions/19693769/xcode5-simulator-unknown-option-character-x-in-xlinker – Nilesh

Trả lời

13

Vấn đề này đã được giải quyết bằng cách nâng cấp Cocoapods 0.36beta.

gem install cocoapods --pre 

Tôi cũng đã phải xóa phiên bản cũ.

gem uninstall cocoapods 
+0

Cảm ơn vì điều đó! Nó đã giúp đỡ tôi. Tôi sẽ thêm rằng trong trường hợp của tôi, tôi đã phải xóa pod từ dự án của tôi và cài đặt lại nó – Nico

+1

Tôi đã phải thêm 'use_frameworks!' Vào podfile của tôi - nếu không giải pháp hoạt động. – subv3rsion

+0

Cập nhật: cocoapods 0.36 được phát hành vì vậy chỉ cần thực hiện 'gem install cocoapods' và thêm' use_frameworks! 'Vào tệp' Podfile' của bạn. Cảnh báo: không phải 100% khung hỗ trợ hiện tại của nhóm - tại thời điểm này tôi sẽ tránh xa các nhóm nhanh chóng. –

Các vấn đề liên quan