Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CocoaPods with XCode 6.0.1 - How can I fix Pods Frameworks appearing in red?

Tags:

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' 

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 

My question is: How can I get the frameworks to appear in black in the navigator, and properly link my pods to my main project?

Xcode screenshot

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

  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.

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

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

like image 447
Ryan Hoegg Avatar asked Oct 07 '14 23:10

Ryan Hoegg


People also ask

Why are frameworks red in Xcode?

The red text indicates that the actual files are not at the path that the project has for them. Get info on the framework and look under the General tab. The first section shows the name and path of the framework bundle itself.

What is use frameworks in CocoaPods?

use_frameworks! tells cocoa pods to use dynamic libraries, and was very prevalent at one point due in particular to swift not supporting static libraries, meaning there was no choice - however you often don't need use_frameworks! anymore. As of Xcode 9 beta 4, and CocoaPods 1.5.

How do you hide the pods warnings?

You can search for "inhibit_all_warnings" in your Xcode build settings of the PodBundle in your project-workspace. Set the value to "YES" and it will hide all your Pod file warnings. If you do it to your workspace it will hide all your project warnings also.


1 Answers

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.

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.

like image 81
H6. Avatar answered Sep 20 '22 11:09

H6.