Swift 2 iOS 9 - ld: 警告:未找到目录 iPhoneSimulator9.0.sdk/Developer/Library/Frameworks

22

我的iOS appTests中有一个警告:

Ld /Users/Mazorati/Library/Developer/Xcode/DerivedData/exchangerate-fxnywlxmtfpaccbcpsmygvhirtma/Build/Products/Debug-iphonesimulator/exchangerateTests.xctest/exchangerateTests normal x86_64
cd /Users/Mazorati/Projects/iOS/exchangerate
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/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -L/Users/Mazorati/Library/Developer/Xcode/DerivedData/exchangerate-fxnywlxmtfpaccbcpsmygvhirtma/Build/Products/Debug-iphonesimulator -F/Users/Mazorati/Library/Developer/Xcode/DerivedData/exchangerate-fxnywlxmtfpaccbcpsmygvhirtma/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -filelist /Users/Mazorati/Library/Developer/Xcode/DerivedData/exchangerate-fxnywlxmtfpaccbcpsmygvhirtma/Build/Intermediates/exchangerate.build/Debug-iphonesimulator/exchangerateTests.build/Objects-normal/x86_64/exchangerateTests.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -mios-simulator-version-min=8.1 -bundle_loader /Users/Mazorati/Library/Developer/Xcode/DerivedData/exchangerate-fxnywlxmtfpaccbcpsmygvhirtma/Build/Products/Debug-iphonesimulator/exchangerate.app/exchangerate -Xlinker -objc_abi_version -Xlinker 2 -framework XCTest -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/Mazorati/Library/Developer/Xcode/DerivedData/exchangerate-fxnywlxmtfpaccbcpsmygvhirtma/Build/Intermediates/exchangerate.build/Debug-iphonesimulator/exchangerateTests.build/Objects-normal/x86_64/exchangerateTests.swiftmodule -Xlinker -dependency_info -Xlinker /Users/Mazorati/Library/Developer/Xcode/DerivedData/exchangerate-fxnywlxmtfpaccbcpsmygvhirtma/Build/Intermediates/exchangerate.build/Debug-iphonesimulator/exchangerateTests.build/Objects-normal/x86_64/exchangerateTests_dependency_info.dat -o /Users/Mazorati/Library/Developer/Xcode/DerivedData/exchangerate-fxnywlxmtfpaccbcpsmygvhirtma/Build/Products/Debug-iphonesimulator/exchangerateTests.xctest/exchangerateTests

错误:

ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Frameworks'

2
可能是Xcode 7 Beta库搜索路径警告的重复问题。 - Paul R
5个回答

39
  1. 点击您的项目(目标)
  2. 点击构建设置
  3. 使用靠近您的项目名称的箭头(在基本和全部按钮正上方)切换到测试目标
  4. 如果警告是针对选项“-L / ...”即Library Search Paths,请删除其中的内容
    如果警告是针对选项“-F / ...”即Framework Search Paths,请删除其中的内容
  5. 清除
  6. 构建

1
请更新答案,包括链接中的信息。 - Esqarrouth
2
我的所有Pod都被删除了,现在它找不到我的其他框架了。这让问题变得更糟了。 - sosale151
因为这只是一个hack,而不是解决方案。你手动创建了一个单元测试类吗?如果是的话,请检查目标。它可能没有附加到主项目上。 - Gautam Jain

5

我收到的警告信息如下:

ld: 警告: 选项'-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/Developer/Library/Frameworks'对应的目录未找到

我的框架搜索路径为空,因此更新/删除此路径以及进行清理和重建并没有起作用...

如果你也遇到了这个问题,尝试删除项目的测试目标


嗯,那确实起作用了...虽然我猜不是最好的解决方案。 - Gene
在测试目标中, 如果警告是关于选项“-L/…”的,则删除库搜索路径中的内容; 如果警告是关于选项“-F/…”的,则删除框架搜索路径中的内容。 - Shoaib

1

我收到了这个警告,还有44个关于i386无效类的错误。对我有帮助的是:

  • 清理产品
  • 关闭Xcode
  • 从~/Library/Developer/Xcode/DerivedData中删除所有文件

0

当我从Finder中打开文件时,我会收到这个错误。但是,如果我从X Code中打开项目,它就可以正常工作。


0

项目“Test”的文件已从解决方案中删除。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接