Reputation: 3820
I follow the instructions to the T. Fresh install of all, yet getting the error:
"No Such module Alamofire"
Directions here:
In the meantime, you can simply add Alamofire as a git submodule, drag the Alamofire.xcodeproj file into your Xcode project, and add the framework product as a dependency for your application target.
And my screenshots
Upvotes: 44
Views: 56715
Reputation: 167
I had same issue,doing that Command+B (Build project) and disappear error.
Upvotes: 0
Reputation: 1
Go to your project folder to be sure you are opening the .xcworkspace
instead of the .xcodeproj
file
Upvotes: -1
Reputation: 587
Upvotes: 1
Reputation: 690
What worked for me: Including "Pods.framework" in "Linked Frameworks and Libraries" of your target if it not there already. (This applies in case you are are using cocoapods and are using frameworks as modules)
Upvotes: 0
Reputation: 772
I resolved the error "No such module" for a fresh project, not for Alamofire but for another library called "RATreeView"
I had to add
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
pod "RATreeView", "~> 2.1.0"
to the Podfile and ran
pod update
The key is to add use_frameworks! It might help someone
Upvotes: 2
Reputation: 776
This order of the Build Phases has worked for me.
You can rearrange Build Phases by dragging them.
Upvotes: 5
Reputation: 155
After following NAlexN steps, it still didn't work for me
I also had to change the order of Build Phases.
It was
- Target Dependencies
- Compile Sources
- Link Binary With Libraries.
After I modified to:
- Target Dependencies
- Link Binary With Libraries.
- Compile Sources
It built and ran fine!
Upvotes: 4
Reputation: 10791
Make sure you haven't added any files from Alamofire to your project except for the Alamofire.xcodeproj
Here is step by step instruction:
import Alamofire
// in your source fileAlamofire.request(.GET, "http://httpbin.org/get")
// use AlamofireUpvotes: 42
Reputation: 9081
Similar errors when I used cocoapods..
I solved the problem by the following steps:
sudo gem install cocoapods --pre
)pod install
Upvotes: 1
Reputation: 3406
You need to add the lib to 'the Link Binary With Libraries
' section also.
The target Dependencies
makes sure your lib is (re)-build before your target (useful when you makes changes to the lib) and the Link section makes sure the lib is available doing the link phase.
EDIT The above description works for most projects. However alarmofire just updated the process needed for this particular project here https://github.com/Alamofire/Alamofire
Upvotes: 13
Reputation: 327
Banged my head against this for a couple days and figured I would throw this in here, our team project had this issue when bringing Alamofire in as a submodule. If you have your own scheme configurations, you need to duplicate them in the Alamofire.xcodeproj too. Which also likely means you need to fork Alamofire to keep these changes synced up.
Upvotes: 11