gpt4 book ai didi

ios - ld : framework not found Alamofire

转载 作者:可可西里 更新时间:2023-11-01 05:43:03 27 4
gpt4 key购买 nike

我花了几天时间尝试解决这个问题,现在我的想法已经用完了。

我有:
Xcode v8.2.1
Apple Swift 版本 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)
cocoapods-1.2.0

我正在创建新的 Xcode 项目(单 View 应用程序),选择清理和构建 - 一切都很顺利。

在根项目路径中的 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)

我尝试将框架搜索路径编辑为 $(inherited) ,清理项目,重新打开 Xcode,尝试新副本,下载以前版本的 Alamofire 以及基本上我在网上找到的所有内容,但到目前为止没有任何效果。

编辑:
添加了概述打印屏幕

编辑 2:在@Jagdeep 建议之后,现在我有不同的错误(附有打印屏幕): enter image description here

project tree

最佳答案

尝试去你的

Target>Build Setting>Build Active Architecture Only

设置它

  • 调试

  • 发布

确保确保您有所有目标的相同配置还有你的

Pods>Build Setting>Build Active Architecture Only

保持相同的值

清理和构建希望有用

关于ios - ld : framework not found Alamofire,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42977862/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com