现在安装了 CocoaPods 和 Braintree 我的项目无法构建
Installed CocoaPods and Braintree now my project won't build
Ld /Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Products/Debug-iphonesimulator/Podding.app/Podding normal x86_64
cd /Users/admin/Development/zift/Podding
export IPHONEOS_DEPLOYMENT_TARGET=8.4
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/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk -L/Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Products/Debug-iphonesimulator -L/Users/admin/Development/zift/Podding/Pods/Braintree/Braintree/PayPal/mSDK -F/Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Products/Debug-iphonesimulator -filelist /Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Intermediates/Podding.build/Debug-iphonesimulator/Podding.build/Objects-normal/x86_64/Podding.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lBraintree -lPayPalMobile-BT -lc++ -framework AVFoundation -framework Accelerate -framework AddressBook -framework AudioToolbox -framework CoreLocation -framework CoreMedia -framework MessageUI -framework MobileCoreServices -framework SystemConfiguration -framework UIKit -weak_framework PassKit -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Intermediates/Podding.build/Debug-iphonesimulator/Podding.build/Objects-normal/x86_64/Podding.swiftmodule -mios-simulator-version-min=8.4 -lPods -Xlinker -dependency_info -Xlinker /Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Intermediates/Podding.build/Debug-iphonesimulator/Podding.build/Objects-normal/x86_64/Podding_dependency_info.dat -o /Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Products/Debug-iphonesimulator/Podding.app/Podding
duplicate symbol _llvm.cmdline in:
/Users/admin/Development/zift/Podding/Pods/Braintree/Braintree/PayPal/mSDK/libPayPalMobile-BT.a(PPZebraAnalyticsWidgetCategories.o)
/Users/admin/Development/zift/Podding/Pods/Braintree/Braintree/PayPal/mSDK/libPayPalMobile-BT.a(PP2FAViewController.o)
duplicate symbol _llvm.embedded.module in:
/Users/admin/Development/zift/Podding/Pods/Braintree/Braintree/PayPal/mSDK/libPayPalMobile-BT.a(PPZebraAnalyticsWidgetCategories.o)
/Users/admin/Development/zift/Podding/Pods/Braintree/Braintree/PayPal/mSDK/libPayPalMobile-BT.a(PP2FAViewController.o)
最后 2 "duplicate" 行重复了大约一百次然后这个错误
ld: 250 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我完全按照 CocoaPods 网站上的说法安装了。使用 Xcode6 和 swift。我尝试了一个桥接头仍然没有成功。我尝试使用一个全新的项目以及相同的结果。我错过了什么?
我通过更改构建设置解决了这个问题。在 Xcode 中单击项目的根目录,然后查看构建设置。导航到链接并确保您正在显示 "ALL" 设置(构建设置的右上角区域 window)。然后从 'Other Linker Flags' 中删除 Obj C 以及设置 $inherited。我能够打扫和建造。希望这可以帮助。我在其他地方看到了这个答案,但我没有弄清楚,因为他们没有删除 $inherited 标志。
Ld /Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Products/Debug-iphonesimulator/Podding.app/Podding normal x86_64
cd /Users/admin/Development/zift/Podding
export IPHONEOS_DEPLOYMENT_TARGET=8.4
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/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk -L/Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Products/Debug-iphonesimulator -L/Users/admin/Development/zift/Podding/Pods/Braintree/Braintree/PayPal/mSDK -F/Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Products/Debug-iphonesimulator -filelist /Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Intermediates/Podding.build/Debug-iphonesimulator/Podding.build/Objects-normal/x86_64/Podding.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lBraintree -lPayPalMobile-BT -lc++ -framework AVFoundation -framework Accelerate -framework AddressBook -framework AudioToolbox -framework CoreLocation -framework CoreMedia -framework MessageUI -framework MobileCoreServices -framework SystemConfiguration -framework UIKit -weak_framework PassKit -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Intermediates/Podding.build/Debug-iphonesimulator/Podding.build/Objects-normal/x86_64/Podding.swiftmodule -mios-simulator-version-min=8.4 -lPods -Xlinker -dependency_info -Xlinker /Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Intermediates/Podding.build/Debug-iphonesimulator/Podding.build/Objects-normal/x86_64/Podding_dependency_info.dat -o /Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Products/Debug-iphonesimulator/Podding.app/Podding
duplicate symbol _llvm.cmdline in:
/Users/admin/Development/zift/Podding/Pods/Braintree/Braintree/PayPal/mSDK/libPayPalMobile-BT.a(PPZebraAnalyticsWidgetCategories.o)
/Users/admin/Development/zift/Podding/Pods/Braintree/Braintree/PayPal/mSDK/libPayPalMobile-BT.a(PP2FAViewController.o)
duplicate symbol _llvm.embedded.module in:
/Users/admin/Development/zift/Podding/Pods/Braintree/Braintree/PayPal/mSDK/libPayPalMobile-BT.a(PPZebraAnalyticsWidgetCategories.o)
/Users/admin/Development/zift/Podding/Pods/Braintree/Braintree/PayPal/mSDK/libPayPalMobile-BT.a(PP2FAViewController.o)
最后 2 "duplicate" 行重复了大约一百次然后这个错误
ld: 250 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我完全按照 CocoaPods 网站上的说法安装了。使用 Xcode6 和 swift。我尝试了一个桥接头仍然没有成功。我尝试使用一个全新的项目以及相同的结果。我错过了什么?
我通过更改构建设置解决了这个问题。在 Xcode 中单击项目的根目录,然后查看构建设置。导航到链接并确保您正在显示 "ALL" 设置(构建设置的右上角区域 window)。然后从 'Other Linker Flags' 中删除 Obj C 以及设置 $inherited。我能够打扫和建造。希望这可以帮助。我在其他地方看到了这个答案,但我没有弄清楚,因为他们没有删除 $inherited 标志。