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.

2
  • Ok thank you I feel dumb since it was such a simple solution somehow I couldn't find it. Thank You! Commented Dec 16, 2015 at 20:57
  • Everybody make this mistake. I also made when I using cocoapods for the first time. Commented Dec 16, 2015 at 20:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.