Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alamofire RED in Xcode project - No Alamofire.framework file

I'm trying to install Alamofire into my Xcode project. However, after following all the steps for installation given by the documentation on the github project, the Alamofire.framework file shows as red in Xcode, and the project will not build. Further, there seems to be no way to fix this, because the Alamofire.framework file does not exist in the package on github.

More detailed explanation:

Following the instructions on github to install manually is fine until the final step: "Click on the + button at the top left of the panel and select "New Copy Files Phase". Rename this new phase to "Copy Frameworks", set the "Destination" to "Frameworks", and add Alamofire.framework."

Because we have already included the project, when we go to add a new framework, Alamofire DOES show up in the list of available things to add. However, when we add it, it shows up red. As we know, this means that the path is incorrect relative to the SDK. Ok, fine... but when we go to correct the path by looking at the Alamofire directory that we put into our project directory, there are a lot of files and none of them are "Alamofire."

I know that I downloaded the package correctly. I installed as a git submodule, I deleted it to retry, I downloaded the zip from github, retried again, etc. Even for this tutorial (http://www.raywenderlich.com/85080/beginning-alamofire-tutorial), if you look at the pictures for this step, we can see that there is no framework file in the directory!

enter image description here

So, Xcode demands a path to a .framework file that doesn't exist... yet we were able to add the framework somehow. Forgive me if I am confused.

There are quite a few questions out there on Alamofire install issues, but I think there must be something here that noobs like me are missing. One poster, here (Alamofire framework not found), is asking something similar, but it appears that her question was misunderstood (she did not accept any answers). I notice the "It's red tho!" frustration showing up in many comments for Alamofire install-related posts- an answer here would really help clear that up.

like image 837
Tim Avatar asked Nov 10 '22 15:11

Tim


1 Answers

I was having the same issue as you, however, I found this question which made me build the project even though everything was red. To my surprise it ended up actually building successfully and afterward I was able to import Alamofire into my Swift files.

I had tried to build earlier unsuccessfully, however, between builds I did change one thing. I moved the Alamofire-master folder to the first level of my App's file structure before including the .xcodeproj file in the Project Navigator, as indicated by the tutorial that you linked. I had initially just moved it from its place in my downloads folder.

The whole copy frameworks part seemed to be a nonissue for me because the framework ended up instead in embedded frameworks automatically, after doing the embedded bin step.

like image 109
Joey Harwood Avatar answered Nov 14 '22 21:11

Joey Harwood