Cocoapods + Cannot load underlying module for 'x'

前端 未结 21 752
梦谈多话
梦谈多话 2020-12-25 09:15

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

相关标签:
21条回答
  • 2020-12-25 09:40

    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

    0 讨论(0)
  • 2020-12-25 09:41

    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.

    0 讨论(0)
  • 2020-12-25 09:41

    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.

    0 讨论(0)
  • 2020-12-25 09:43

    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

    0 讨论(0)
  • 2020-12-25 09:45

    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.

    0 讨论(0)
  • 2020-12-25 09:45

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

    0 讨论(0)
提交回复
热议问题