"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:

一般水龙头

依赖


Looks like you are using the module by directly dropping the source files into your project.

If that's the case, you don't have to use import Alamofire header or use Alamofire( dot ) in the beginning of every method.

Just use the code as below omitting Alamofire tag.

request(.GET, "https://httpbin.org/get") 

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

  • Download Alamofire
  • Drag Alamofire project in your project directory
  • Check alamofire deployment target same as your project
  • Go to your project general settings, click on the + button under the "Embedded Binaries" section.
  • 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.
  • Select the top Alamofire.framework for iOS and the bottom one for OS X.
  • 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.

  • I was able to resolve this issue changing my Podfile. I originally had the reference to Alamofire in a target:

    The problem disappeared when I changed the podfile to the following:

    platform :ios, '8.0'
    use_frameworks!
    
    pod 'Alamofire', '~> 3.0'
    pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
    
    target 'xxxxxxx' do
        pod 'GoogleMaps'
    end
    
    target 'xxxxxxxTests' do
        pod 'GoogleMaps'
    end
    
    链接地址: http://www.djcxy.com/p/26482.html

    上一篇: 为什么Equals()和==被设计为不同?

    下一篇: “没有这样的模块'Alamofire'''不会识别框架