我花了几天时间试图解决这个问题,现在我的想法已经不多了.
我有:
Xcode v8.2.1
Apple Swift 3.0.2版(swiftlang-800.0.63 clang-800.0.42.1)
的CocoaPods-1.2.0
我正在创建新的Xcode项目(单视图应用程序),选择干净和构建 – 一切都像魅力.
在根项目路径中的pod init后,我正在编辑我的Podfile,如下所示:
# Uncomment the next line to define a global platform for your project # platform :ios,'9.0' source 'https://github.com/CocoaPods/Specs.git' platform :ios,'10.0' use_frameworks! target 'test' do # Comment the next line if you're not using Swift and don't want to use dynamic frameworks pod 'Alamofire','~> 4.4' # Pods for test end
现在,当我尝试清理并重建应用程序时,我遇到了构建错误,如下所示:
d /Users/Dawid/Library/Developer/Xcode/DerivedData/test-auxygswgvxhnqfamjqqncqxaieqk/Build/Products/Debug-iphonesimulator/test.app/test normal x86_64 cd /Users/Dawid/xCode/test export IPHONEOS_DEPLOYMENT_TARGET=10.2 export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.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 x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk -L/Users/Dawid/Library/Developer/Xcode/DerivedData/test-auxygswgvxhnqfamjqqncqxaieqk/Build/Products/Debug-iphonesimulator -F/Users/Dawid/Library/Developer/Xcode/DerivedData/test-auxygswgvxhnqfamjqqncqxaieqk/Build/Products/Debug-iphonesimulator -F/Users/Dawid/Library/Developer/Xcode/DerivedData/test-auxygswgvxhnqfamjqqncqxaieqk/Build/Products/Debug-iphonesimulator/Alamofire -filelist /Users/Dawid/Library/Developer/Xcode/DerivedData/test-auxygswgvxhnqfamjqqncqxaieqk/Build/Intermediates/test.build/Debug-iphonesimulator/test.build/Objects-normal/x86_64/test.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=10.2 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/Dawid/Library/Developer/Xcode/DerivedData/test-auxygswgvxhnqfamjqqncqxaieqk/Build/Intermediates/test.build/Debug-iphonesimulator/test.build/Objects-normal/x86_64/test_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/Dawid/Library/Developer/Xcode/DerivedData/test-auxygswgvxhnqfamjqqncqxaieqk/Build/Intermediates/test.build/Debug-iphonesimulator/test.build/Objects-normal/x86_64/test.swiftmodule -framework Alamofire -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/Dawid/Library/Developer/Xcode/DerivedData/test-auxygswgvxhnqfamjqqncqxaieqk/Build/Intermediates/test.build/Debug-iphonesimulator/test.build/test.app.xcent -framework Pods_test -Xlinker -dependency_info -Xlinker /Users/Dawid/Library/Developer/Xcode/DerivedData/test-auxygswgvxhnqfamjqqncqxaieqk/Build/Intermediates/test.build/Debug-iphonesimulator/test.build/Objects-normal/x86_64/test_dependency_info.dat -o /Users/Dawid/Library/Developer/Xcode/DerivedData/test-auxygswgvxhnqfamjqqncqxaieqk/Build/Products/Debug-iphonesimulator/test.app/test ld: warning: directory not found for option '-F/Users/Dawid/Library/Developer/Xcode/DerivedData/test-auxygswgvxhnqfamjqqncqxaieqk/Build/Products/Debug-iphonesimulator/Alamofire' ld: framework not found Alamofire clang: error: linker command Failed with exit code 1 (use -v to see invocation)
我尝试编辑框架搜索路径到$(继承),清理项目,重新打开Xcode,尝试新版本,下载以前版本的Alamofire,基本上我在网上找到的所有东西,但到目前为止没有任何工作.
编辑:
添加了打印画面概述
编辑2:
在@Jagdeep建议之后,现在我有不同的错误(附带打印屏幕):
解决方法
试着去找你的
目标>构建设置>仅构建活动架构
设置它
>是的,适用于Debug
>不发布
确保所有目标都有相同的配置
也在你的
Pods>Build Setting>Build Active Architecture Only
保持相同的价值观.
清洁和建造希望它有效