Leem.fin Leem.fin - 2 years ago 153
Swift Question

Always get build error : No such module 'Alamofire'

I followed the instruction of

in github,

I created an xcode project named
& I closed it.

I go to the project folder run
pod init
command which generates a Podfile. Then I added the following code to the Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

pod 'Alamofire', '~> 3.0'

Then, I run command
pod install
and this is the result in terminal:

Updating local specs repositories

CocoaPods 1.0.0.beta.6 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.

Analyzing dependencies
Downloading dependencies
Installing Alamofire (3.3.0)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `cocoapods-test.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

Then, in my project folder there is a new file called
. I double clicked it which opens my xcode again, and I can see the Alamofire module.

Then, I opened my project's
class, and
import Alamofire
. But no matter how many times I clean & build, I always get error
No such module 'Alamofire'
. Here is the screenshot:

enter image description here

Why I get this problem though I followed the instruction step by step?

(I am using
XCode 7.2.1
Swift 2.1.1
Alamofire 3.3.0

======= UPDATE ========

I tried @LK Yeung 's answer, uncomment
import Alamofire
, then clean & build again, I got a bunch of compiler errors from Alarmofire:

enter image description here

Answer Source

I was having this exact same problem. Please make sure that you are on Xcode 7.3 and using Swift 2.2.

You can check your Swift version using xcrun swift -version. Updating Xcode to 7.3 should also automatically update Swift.

Updating Xcode resolved this issue for me.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download