5

I am trying to use the cocoapod Alamofire in Swift. However, I get the error "No Such Module" when I Import Alamofire I am using Xcode 7.2 Alamofire 3.0 and Swift 2 The following are the steps I took

1) In terminal I ran

$ sudo gem install cocoapods 

There were no errors then

2) I ran

cd ~/Path/To/Folder/Containing/Project (once in the project folder I ran)

pod init 

3) Then

open -a Xcode Podfile 

4) Then I added

source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' use_frameworks! pod 'Alamofire', '~> 3.0' 

to the Podfile

5) Then I ran

pod 'Alamofire', '3.0' 

followed by

pod install 

I added $(SRCROOT) to runpath and buildpath.

Also I found this answer No such module "Armchair" saying to add the pre-release but I don't really understand how to do this or if this is my problem. Maybe this is obvious ,however I'm new to Swift and am not understanding. Also should Alamofire show up in my frameworks, or pods folder? It isn't in either. files in project

1 Answer 1

11

After pod init you must use the new <YourProject>.xcworkspace instead of <YourProject>.xcodeproj.

The xcworkspace contains your project and your pods after pod install.

Sign up to request clarification or add additional context in comments.

2 Comments

Ok thank you I feel dumb since it was such a simple solution somehow I couldn't find it. Thank You!
Everybody make this mistake. I also made when I using cocoapods for the first time.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.