Xcode 7 库搜索路径警告

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30827022/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 18:07:51  来源:igfitidea点击:

Xcode 7 Library search path warning

xcodexcode7

提问by arwaz shaikh

This is the warning that it is showing:

这是它显示的警告:

directory not found for option '-F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/Developer/Library/Frameworks' "

找不到选项“-F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/Developer/Library/Frameworks”的目录

Can anyone help resolve the warning?

任何人都可以帮助解决警告吗?

回答by King-Wizard

This is how I fixed this problem

这就是我解决这个问题的方法

Further to a migration of my Xcode project, from Xcode 6.4 to Xcode 7, I get the warning message below (after compilation) for the Test target:

进一步将我的 Xcode 项目从 Xcode 6.4 迁移到 Xcode 7,我收到以下测试目标的警告消息(编译后):

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

Actually I found something when comparing a new project vs an older one...

实际上我在比较新项目和旧项目时发现了一些东西......

In the old project, the warning was only being produced by the test targetof my projects. Under 'Search Paths', I found it was including two items under 'Framework Search Paths':

在旧项目中,警告仅由我的项目的测试目标产生。在“搜索路径”下,我发现它在“框架搜索路径”下包含两个项目:

$(SDKROOT)/Developer/Library/Frameworks
$(inherited)

The new project kept the 'Framework Search Paths'empty.

新项目将“框架搜索路径”保留为空。

Deleting those entries in my older project then removed the warning.

在我的旧项目中删除这些条目然后删除了警告。

Notes:

笔记:

I have not exhaustively compared settings, so there may be additional differences.

我没有详尽地比较设置,因此可能存在其他差异。

Also, just in case if one day you re-encounter one of the two following warning messages, just remember that you will have to do that: if the warning is for option '-L/...'that is Library Search Paths, delete the stuff there. However if the warning is for option '-F/...'that is Framework Search Paths, delete the stuff there.

此外,如果有一天您再次遇到以下两个警告消息之一,请记住您必须这样做:如果警告是针对'-L/...'库搜索路径的选项,请删除那里的内容。但是,如果警告是针对'-F/...'框架搜索路径的选项,请删除那里的内容。

回答by Dave Ruske

Based on the error message, it sounds like the first order of business is to get the target's path straightened out. You can edit the paths as shown in the answers to this StackOverflow question. Be sure to check the path for all your targets if you're not sure which is generating the error --- this threw me for a bit after upgrading a project to the Xcode 7 beta; there was a path in the FRAMEWORK_SEARCH_PATHS for the test target that needed to be deleted. The path that was in there was exactly the path you report getting the warning on; removing the path eliminated it.

根据错误消息,听起来首要任务是理顺目标的路径。您可以编辑此 StackOverflow 问题的答案中所示的路径。如果您不确定哪个产生了错误,请务必检查所有目标的路径 --- 在将项目升级到 Xcode 7 beta 后,这让我有点困惑;FRAMEWORK_SEARCH_PATHS 中有一个需要删除的测试目标的路径。那里的路径正是您报告收到警告的路径;删除路径消除了它。

回答by Eric Murphey

King-Wizardis essentially correct, to elaborate a little more -

King-Wizard基本上是正确的,再详细说明一下——

Xcode 7 is looking for your testing framework XCtest.frameworkin a path that does not exist. The path set by $(SDKROOT)/Developer/Library/Frameworksunder 'Search Paths -> Framework Search Paths' is looking for the framework in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/Developer/Library/Frameworkswhich is not a valid path. You can delete the line $(SDKROOT)/Developer/Library/Frameworksto remove the error and still be able to run tests.

Xcode 7 正在XCtest.framework不存在的路径中寻找您的测试框架。$(SDKROOT)/Developer/Library/Frameworks在“搜索路径 -> 框架搜索路径”下设置的路径正在寻找/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/Developer/Library/Frameworks不是有效路径的框架。您可以删除该行$(SDKROOT)/Developer/Library/Frameworks以消除错误,并且仍然能够运行测试。

The correct path to 'XCTest.framework' is /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworksfor those that are curious.

'XCTest.framework' 的正确路径是/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks为那些好奇的人准备的。

I hope that helps.

我希望这有帮助。

回答by Jorge Casariego

I had the same error with Xcode 9.2 and here is my solutions without doing by hand:

我在 Xcode 9.2 上遇到了同样的错误,这是我的解决方案,无需手动操作:

  1. Click on your project in Project Navigator
  2. Go to targets and click on MyProjectNameTest
  3. Click on Build Settings and Search for “Framework Search Paths
  4. Under Framework Search Paths, delete the paths and keep the “$(inherited)”.
  1. 在项目导航器中单击您的项目
  2. 转到目标并单击MyProjectNameTest
  3. 单击 Build Settings 并搜索“ Framework Search Paths
  4. Framework Search Paths 下,删除路径并保留“$(inherited)”。

enter image description here

在此处输入图片说明

For those of you that have the following error:

对于那些有以下错误的人:

directory not found for option ‘-L/…

找不到选项“-L/...”的目录

that means it's a Library Error, so you can try follow the below steps:

这意味着这是一个库错误,因此您可以尝试按照以下步骤操作:

  1. Click on your project (targets)
  2. Click on Build Settings, Search for “Library Search Paths”
  3. Under Library Search Paths, delete the paths and keep the “$(inherited)”
  1. 单击您的项目(目标)
  2. 单击构建设置,搜索“库搜索路径”
  3. 在 Library Search Paths 下,删除路径并保留“$(inherited)”