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
In my case:
1. Comment line of //import Pod_Module
2. Go to Project -> Clean or use shortcut key (Command+Shift+K)
2. Close your project
3. In terminal go to your project directory
4. run > pod install
5. open .xcworkspace
file and build it!
6. Uncomment line of import Pod_Module
Im my case it was a different reason, it was the Other swift flags in my targets build setting, i had to add inherited flag to the top.
If you have verified that your Pods have been successfully installed, then the error may be associated with your derived data remaining from before you installed the Pods. You can clear your derived data by going to File -> Workspace Settings... -> Derived Data
. Deleting the derived data folder associated with your app and cleaning your build should solve the problem.
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
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.
Setting GCC_SYMBOLS_PRIVATE_EXTERN
(displayed as "Symbols Hidden by Default" in target settings) to YES
in framework being linked helped me to get rid of this error. I've spent 2 days to find this out, hope it will help someone :)