Cocoapods + Cannot load underlying module for 'x'

cannot load underlying module for 'xctest'
failed to load module giphyuisdk
cannot load underlying module for xctest cocoapods
cocoapods version
missing required module 'firebase
no such module swift cocoapods

I am running XCode 7, Swift 2.0, iOS 9.

I want to install Alamofire in my project using Cocoapods. I have done the following:

gem install cocoapods

pod setup

pod init

Updated Podfile to:

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
use_frameworks!

target 'JSONeg' do

  pod 'Alamofire', :branch => 'swift-2'

end

Then I installed the pod:

pod install

And I added the following to ViewController.swift

import Alamofire

This raises the following error:

Cannot load underlying module for 'Alamofire'

I tested with another pod and it raised the same error, so I guess the problem is with the installation of Cocoapods. Any help would be greatly appreciated.

This seems to be a bug in XCode. I had the same problem, and as described in the comments of another answer to this question, building the project made the error go away.

Cannot load underlying module for 'Alamofire' · Issue #441 , Unable to successfully use/import Alamofire. Xcode 6.3 with a clean project and cocoapods install. Cannot load underlying module for ‘x’for SWIFT : How to fix the Issue: step:1 Create a New project and build&run Successfully without installing pod. step:2 After build&run the Project Successfully ,Now try to install pod and then try to importrealm,alamofire,charts etc it will work like a charm.

Go to Product > Build and it will resolve the problem:

[Build Error] Cannot load underlying module for 'SwiftyJSON' · Issue , Build the project again. Seems to be an xcode bug. https://stackoverflow.com/​questions/32673866/cocoapods-cannot-load-underlying-module-for  Cannot reproduce. Try cleaning your project or re-installing from CocoaPods. If you continue to experience problems and think that this might be an issue with CocoaPods, please open an issue with them. Otherwise, please ask a question on Stack Overflow with the "Alamofire" tag.

Cannot load underlying module for 'x'for SWIFT :

How to fix the Issue:

step:1 Create a New project and build&run Successfully without installing pod.

step:2 After build&run the Project Successfully ,Now try to install pod and then try to importrealm,alamofire,charts etc it will work like a charm.

Failure Case --> New project -> Add (realm,alamofire,charts etc) via cocoapods w/o building first -> open Xcode workspace -> build&run

Success Case -->New project -> build&run -> add (realm,alamofire,charts etc)via cocoapods -> open Xcode workspace -> build&run again = success

iOS Swift Troubleshooting: Cannot Load Underlying Module For , The easiest explanation is that because you just import the cocoapod, it still hasn'​t been built yet, while the other cocoapods in your project have. Cannot load underlying module for ~ CocoaPods Swift. More than 1 year has passed since last update. Cannot load underlying module for ~ commands + b.

This worked for me:

  1. Close your project
  2. In terminal go to your project directory
  3. Add this command: pod update
  4. After that all your pods will be updated. Just run your project

Technical Q&A QA1954: Cannot load underlying module for XCTest, Q: My Xcode project fails compiling with a "Cannot load underlying module for XCTest" error message. How do I resolve this issue? A: You may  Cannot load underlying module for 'RealmSwift' #2885. make sure you build+run the project before installing Realm using cocoapods. My specs:-Swift project

Once you have installed Alamofire pod.

Step.1 you should open your project by double click on your_project_name.xcworkspace file.

Step.2 Go to project settings --> Build Phases --> Link Binary with Libraries --> Add framework "Alamofire.framework"

Thats it!!

Now you can import the module

Cocoapods + Cannot load underlying module for 'x', import Alamofire. This raises the following error: Cannot load underlying module for 'Alamofire'. I tested with another pod and it raised the same  Ensured you are running latest version of Cocoapods; Cleared your Pods cache and re-installed SnapKit? Cleaned and re-built your Xcode project? Normally these integration issues is one of the above. If SnapKit is compiling fine into a .framework or .module on your system it's something to do with Xcode's build system or your integration method.

Cannot load underlying module for 'CryptoSwift' : swift, Cannot load underlying module for 'CryptoSwift'. I'm not sure what I'm doing wrong. I used carthage to fetch and build the latest version, followed the directions  + .left: on the left of the bubble. + .right: on the right of the bubble. + .any: use this option to let the EasyTipView automatically find the best arrow position. If the passed in arrow cannot be applied due to layout restrictions, a different arrow position will be automatically assigned.

Cannot load underlying module for 'SideMenu', Cannot load underlying module for 'SideMenu' I did the basic setup installing the pod (I've already got cocoapod installed): pod init open -a  Cannot load underlying module for 'Charts' I'd try to install it using CocoaPods instead. I'm fairly new in CocoaPods so can't really help you there, but just

ios Cocoapods + Cannot load underlying module for 'x'?, ios Cocoapods + Cannot load underlying module for 'x'? step:1 Create a New project and build&run Successfully without installing pod. step:2 After build&run the  Cannot load underlying module for XCTest (8) After lots of troubleshooting and bouncing around Stack Overflow pages such as this one, I managed to find one detail that was not mentioned on the other iOS Unit Test troubleshooting pages.

Comments
  • check you have imported the needed frameworks
  • I almost come here at the start of any project... Thanks buddy
  • Damn workaround still works.. XCode should be open sourced.
  • Also, remove Pod/ folder before reinstalling
  • True, that was the main problem,you have to clean with command-shift-K
  • I had to set it from YES to NO. Weird.
  • After everything else failed, this actually worked. Thanks a lot.
  • Yes it was the most recent build. I just figured out the problem though. I built the project, and all of a sudden, it worked.
  • Ok then please answer your own question with the solution you figured out so that others can fix that problem when they encounter that,