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.
Could not load underlying module
Build Settings -> Framework Search Paths
.Build Settings
.In summary, make sure your
<Project Root>
path contains no space. Otherwise, rename thedir
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'
Same issue for me. I solved that by removing Alamofire version in pod file.
Pod file as
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.
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
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.
Go to Product > Build and it will resolve the problem: