没有这样的模块' Alamofire'在XCode 7.3& Swift 2.2

时间:2016-06-07 07:24:42

标签: ios xcode swift cocoapods alamofire

我正在通过cocoapods在我的新swift项目中集成Almofire。成功安装Alamofire pod后,我无法在swift文件中导入它。 Xcode显示以下错误。

  

没有这样的模块' Alamofire'

以下是我的Podfile以供参考

source 'https://github.com/CocoaPods/Specs.git'

# Uncomment this line to define a global platform for your project
 platform :ios, '9.0'
# Uncomment this line if you're using Swift
 use_frameworks!

target 'CoreDataSample' do
    pod 'Alamofire', '~> '3.4'
end

target 'CoreDataSampleUITests' do

end

我已经在github上的Almofire中提到了以下问题

  1. Issue #551
  2. Issue #1130
  3. 还尝试了以下内容

    1. 项目清洁
    2. 项目构建
    3. 删除派生数据
    4. 任何建议都会受到赞赏。

1 个答案:

答案 0 :(得分:0)

在您的pod文件

中尝试此操作
# Uncomment this line to define a global platform for your project
 platform :ios, '9.0'

target 'demoAlamofire' do
  # Comment this line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for demoAlamofire

  pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire'

  target 'demoAlamofireTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'demoAlamofireUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end

我希望这会对你有所帮助。