Search code examples
iosxcodeswiftalamofire

"No such module 'Alamofire'" won't recognize framework


I am trying to add Alamofire to a new XCode project with Swift. I feel like I have tried everything.

Every time I try to add

import Alamofire

I get "No such module".

I have tried installing it as stated on https://github.com/Alamofire/Alamofire, I tried doing it manually first, then Carthage and Cocoapods, but with the same result.

I have tried deleting the DerivedData folder and rebuilding the project without any luck.

It is a completely clean install, yet it just won't recognize the framework. I have tried the suggestions in the first 10 Google searches and here on Stackoverflow (Cannot install Alamofire in new Xcode Project. "No Such module Alamofire") Here are some screenshots from my latest manual attemp:

General tap

Dependencies


Solution

  • I know it's late answer, but I was facing same problem with Xcode 8 Swift 3.0. I follow this Alamofire link and added framework manually. Its working fine. One of my project stuck on 'no such module' error, I cleaned derived data (Cleaning derived data removed source files of Alamofire. I added it again in my project ;) ) and it works like charm :).

    Followed instructions

    1. Download Alamofire
    2. Drag Alamofire project in your project directory
    3. Check alamofire deployment target same as your project
    4. Go to your project general settings, click on the + button under the "Embedded Binaries" section.
    5. You will see two different Alamofire.xcodeproj folders each with two different versions of the Alamofire.framework nested inside a Products folder. It does not matter which Products folder you choose from, but it does matter whether you choose the top or bottom Alamofire.framework.
    6. Select the top Alamofire.framework for iOS and the bottom one for OS X.
    7. And that's it! The Alamofire.framework is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device.