我正在尝试为我的 macbook pro 构建一个菜单栏应用程序,并且需要发出 GET 请求以从 API 获取数据。但是,当我尝试导入 Alamofire 时,我得到了
没有这样的模块“Alamofire”
这是我的播客文件,
source 'https://github.com/CocoaPods/Specs.git'
platform :osx, '10.9'
use_frameworks!
target 'WakaMenu' do
pod 'Alamofire', '~> 3.3'
pod 'AlamofireObjectMapper', '~> 3.0'
end
target 'WakaMenuTests' do
end
我正在运行 Xcode 7.3,我的项目基础 SDK 和部署目标是 10.11
当我尝试仅使用平台 ios 9.0 时,它仍然显示错误。
最佳答案
试试这个...
source 'https://github.com/CocoaPods/Specs.git'
platform :osx, '10.12'
use_frameworks!
target 'targetname' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :tag => ‘4.3.0’
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
关于ios - Alamofire 不会在 podfile 中使用 osx 而不是 ios,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36868858/