CocoaPods与XCode 6.0.1 - 如何修复出现红色的Pods框架? [英] CocoaPods with XCode 6.0.1 - How can I fix Pods Frameworks appearing in red?

查看:1827
本文介绍了CocoaPods与XCode 6.0.1 - 如何修复出现红色的Pods框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Xcode 6.0.1中创建了一个新项目并创建了以下Podfile:

I have created a new project in Xcode 6.0.1 and created the following Podfile:

source 'https://github.com/CocoaPods/Specs'
platform :ios, '8.0'

pod 'AFNetworking', '~> 2.0'

然后我运行 pod install ,并在Xcode中打开了xcworkspace。当我构建项目时,所有框架都显示为红色。例如,在Pods项目下,Foundation.framework显示为红色,并且指的是我的计算机上不存在的路径:

I then ran pod install, and opened the xcworkspace in Xcode. When I build the project, all the frameworks appear in red. For example, under the Pods project, the Foundation.framework appears in red, and refers to a path on my computer that doesn't exist:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/Foundation.framework

我的问题是:如何让框架在导航器中以黑色显示,并将我的pod正确链接到我的主项目?

我在问题的答案中提到了一些更改:

I have made a couple changes mentioned in the answers to this question:


  1. 最初,libpods.a产品也以红色显示。我通过将按配置构建产品路径更改为 $(BUILD_DIR)/ $(CONFIGURATION)修复了此问题那样。

  1. Originally, the libpods.a Product appeared in red as well. I fixed that by changing the Per-configuration Build Products Path to $(BUILD_DIR)/$(CONFIGURATION) after reading that someone else fixed their problem that way.

我确保我的 Base SDK 在我能找到的所有目标上都是iOS 8.0。

I have made sure my Base SDK is iOS 8.0 on all the targets I can find.

我已经确认我的有效架构已设置为arm64 armv7 armv7.1,可以找到我能找到的所有目标。

I have verified that my Valid Architectures are set to "arm64 armv7 armv7.1" for all the targets I can find.


推荐答案

我遇到了同样奇怪的问题,在一台机器上正确识别的库,但不是另一个 - 他们也是红色的。

I had the same strange problem, where the libraries where correctly recognized on one machine, but not on another - there they were also in red.

解决方案是将 Pods 目标添加到建筑方案(产品>方案>编辑方案......然后添加+ Pods主目标并将其放在主目标前。)
然后清理 build 项目。

The solution was to add the Pods target to the building scheme ("Product > Scheme > Edit Scheme..." then add with + the Pods main target and put it in front of your main target.) Then clean and build the project.

这篇关于CocoaPods与XCode 6.0.1 - 如何修复出现红色的Pods框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆