Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode No such Module

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

like image 880
user5385949 Avatar asked Dec 16 '15 20:12

user5385949


People also ask

What is a module in Xcode?

Module: A set of parts that can be assembled into a structure. To Xcode, that means you can have a group of lines of code that you can (re)use in different places without having to write that code again.


Video Answer


1 Answers

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.

like image 110
Haroldo Gondim Avatar answered Sep 26 '22 14:09

Haroldo Gondim