Search code examples
iosswiftcocoapodsalamofire

Can't import Alamofire


I'm trying to import Alamofire inside my class but I obtain the error message Cannot load underlying module for 'Alamofire' . I did the same steps importing another library (SwiftyJSON), and it worked well. This is my podfile:

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

target 'MyApp' do
    pod 'SwiftyJSON', '~> 2.2.0'
    pod 'Alamofire', '~> 1.2'
end

target 'MyAppTests' do
    pod 'SwiftyJSON', '~> 2.2.0'
    pod 'Alamofire', '~> 1.2'
end

Then I use $ pod install and I can find Alamofire as a module under Pods.

When I put in my class import Alamofire, it isn't found (but SwiftyJSON is).

What I'm doing wrong?


Solution

  • This issue was already reported on Github: https://github.com/Alamofire/Alamofire/issues/441

    Possible fixes mentioned there:

    • Product -> Clean
    • Restart Xcode