在 Xcode 7.0 中获取与框架相关的警告
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30810874/
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
Getting Framework related warning in Xcode 7.0
提问by Sabhay Sardana
error I'm receiving is this
我收到的错误是这个
directory not found for option '-F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Frameworks'
找不到选项“-F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Frameworks”的目录
I have no idea why this is coming is this related to framework ?
我不知道为什么会这样,这与框架有关吗?
回答by hEADcRASH
I get rid of these by finding the target(s) that generated the error, then removing/deleting the (odd) path in the "Framework Search Paths" build setting:
我通过找到产生错误的目标,然后在“框架搜索路径”构建设置中删除/删除(奇数)路径来摆脱这些:
回答by prankin
What solves this for me is to create a new scheme. Click on Product-> Scheme -> New Scheme and just hit OK. Then my app seems to build and run.
对我来说解决这个问题的是创建一个新方案。单击产品-> 方案-> 新方案,然后点击确定。然后我的应用程序似乎构建并运行。
回答by Grigo
After much digging, I found this is actually related to my test target of my app.
经过多次挖掘,我发现这实际上与我的应用程序的测试目标有关。
The Fix
修复
If you select your project, and look under ‘Targets', you should see two targets. One is your app and the other one is your test. Under ‘Search Paths' (in my test target), I found it was including two items under ‘Framework Search Paths':
如果您选择您的项目,并在“目标”下查看,您应该会看到两个目标。一个是您的应用程序,另一个是您的测试。在“搜索路径”下(在我的测试目标中),我发现它在“框架搜索路径”下包含两个项目:
$(SDKROOT)/Developer/Library/Frameworks $(inherited)
$(SDKROOT)/Developer/Library/Frameworks $(继承)
Deleting those entries in my older project then removed the warning. I did not have to make any changes to the other target.
在我的旧项目中删除这些条目然后删除了警告。我不必对另一个目标进行任何更改。
回答by marmaralone
Instead of deleting Framework Searh Paths (It causes other problems specially if you're using Fabric framework), you can change this line :
您可以更改以下行,而不是删除 Framework Searh Paths(如果您使用的是 Fabric 框架,它会导致其他问题):
$(SDKROOT)/Developer/Library/Frameworks
$(SDKROOT)/开发者/库/框架
with
和
$(SDKROOT)/Developer/Library/PrivateFrameworks
$(SDKROOT)/Developer/Library/PrivateFrameworks
and it should work.
它应该工作。
回答by Markus
Please, let me this contribution.
请让我做出这个贡献。
I had this problem working with Xcode 8.0 (8A218a) and for a iOS Deployment Target 10.
我在使用 Xcode 8.0 (8A218a) 和 iOS 部署目标 10 时遇到了这个问题。
Concretely, Xcode could not read the MapKit.framework. Error message said:
具体来说,Xcode 无法读取 MapKit.framework。错误信息说:
ld: warning: ignoring file /Users/Admin/Documents/APPS/PeekaWish/PeekaWish/MapKit.framework/MapKit, missing required architecture x86_64 in file /Users/Admin/Documents/APPS/PeekaWish/PeekaWish/MapKit.framework/MapKit (3 slices)
ld:警告:忽略文件 /Users/Admin/Documents/APPS/PeekaWish/PeekaWish/MapKit.framework/MapKit,缺少文件 /Users/Admin/Documents/APPS/PeekaWish/PeekaWish/MapKit.framework/MapKit 中所需的架构 x86_64( 3片)
The worst thing was that I had not made any changes. The inconsistency apparently occurred after a bad Product Build(My project folder appear duplicated on the Xcode Editor, on Left Side, the Navigator Bar)
最糟糕的是我没有做任何改变。在错误的产品构建之后显然发生了不一致(我的项目文件夹在 Xcode 编辑器的左侧,导航栏上出现重复)
I lost a lot of time: linking repeatedly the MapKit.framework
我浪费了很多时间:反复链接 MapKit.framework
Finally, I found the solution. It is a mix of above solutions.
最后,我找到了解决方案。它是上述解决方案的混合。
1 STEP: Click on Product-> Scheme -> New Scheme and just hit OK
1 步:点击产品-> 方案-> 新方案,然后点击确定
On TARGETS (the App) and Build Settings:
关于目标(应用程序)和构建设置:
2 STEP: Deleting Framework Search Paths (leave these fields empty)
3 STEP: Always Search User Paths -> NO
2 步骤:删除框架搜索路径(将这些字段留空)
3 步:始终搜索用户路径 -> 否