Cocoapods + Cannot load underlying module for 'x'

前端 未结 21 780
梦谈多话
梦谈多话 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:48

    I tried all of these solutions: Re-building, Cleaning, Re-installing the pods, etc., but In my case, it was a problem of changing my 'Build Active Architecture Only' setting to 'No', due to an AR library I was using. Changed it back to 'Yes' and it was fixed. Hope this helps somebody.

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

    I am on Xcode Version 8.3.1 (8E1000a). Somehow this problem occurs when I wanted to pod install SwiftCloudant module. Probably I did not close my Xcode when I run pod install.

    I fixed this manually adding the SwiftCloudant.framework in the Targets > General tab.

    Targets > General > Linked Frameworks and Libraries

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

    Have you checked if you have a recent version of Cocoapods ? You can update by either updating all your gems :

    sudo gem update
    

    or just reinstall Cocoapods:

     [sudo] gem install cocoapods
    

    If that doesn't help take also a look at : CocoaPods - build for iOS 9 / Swift 2 with Xcode-beta

    where is shows you how to easily change the Command-Line tools version in the Xcode Preferences "Locations" tab, and change "Command Line Tools" to Xcode 7.0.

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

    Follow the steps:

    1.Install pods 2.Open workSpace 3.Run/build your application 4.Then you can import the framework

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

    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
    0 讨论(0)
  • 2020-12-25 09:54

    Could not load underlying module

    1. Check framework path: Build Settings -> Framework Search Paths.
    2. Make sure the path to a framework contains no space.
    3. If the path contains a variable, find the value of the variables by searching the variable name in your Build Settings.
    4. Make sure the value of the variables contains no space.
    5. If the path contains spaces, rename those directories that contain spaces.
    6. Clean and build the project.

    In summary, make sure your <Project Root> path contains no space. Otherwise, rename the dir that contains spaces, then clean and build your project.

    e.g. If this is your project root: /Users/handsomeboy/ios app/Fancy App/, rename the folder that has spaces. One way to get rid of the space: change 'ios app' to 'ios_app'

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