Ios CocoaPods找不到pod的兼容版本;阿拉莫菲尔5.0.0-rc.2“;
我在swift项目中通过CocoaPods使用了Ios CocoaPods找不到pod的兼容版本;阿拉莫菲尔5.0.0-rc.2“;,ios,swift,cocoapods,alamofire,Ios,Swift,Cocoapods,Alamofire,我在swift项目中通过CocoaPods使用了'Alamofire','~>5.0.0-beta.5'。现在我尝试使用Alamofire(~>5.0.0-rc.2) 不幸的是,在应用“pod安装”命令行后,我出现了以下错误: CocoaPods在中找不到pod“Alamofire”的兼容版本 播客文件: 阿拉莫菲尔(~>5.0.0-rc.2) 有什么帮助吗?我想你可以先使用pod search Alamofire,然后使用列表上的版本。如果版本不是必需的,您可以使用pod'Alamofire'
'Alamofire','~>5.0.0-beta.5'
。现在我尝试使用Alamofire(~>5.0.0-rc.2)
不幸的是,在应用“pod安装”命令行后,我出现了以下错误:
CocoaPods在中找不到pod“Alamofire”的兼容版本
播客文件:
阿拉莫菲尔(~>5.0.0-rc.2)
有什么帮助吗?我想你可以先使用
pod search Alamofire
,然后使用列表上的版本。如果版本不是必需的,您可以使用pod'Alamofire'
因为该版本是新的(仅2天前),您首先需要更新本地规范存储库
在您的Podspec
文件中,放入以下内容:
pod 'Alamofire', '~> 5.0.0-rc.2'
在终端上,运行:
pod update
然后:
输出:
Analyzing dependencies
Downloading dependencies
Using Alamofire (5.0.0-rc.2)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
可能在某些情况下,其他点不起作用。检查此问题:
platform :ios, '9.0' // check platform :ios version
target "app_name" do
pod 'Alamofire', '~> 5.0.0-rc.3'
end
在我的情况下,部署目标设置为9.0,但Alamofire 5+在10.0版本上
/** Alamofire.podspec **/
...
s.ios.deployment_target = '10.0'
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '3.0'
s.swift_versions = ['5.0', '5.1']
...
只要将
platform:ios,'9.0'
替换为platform:ios,'10.0'
,问题就会解决 如果执行此操作后仍不工作,请从应用程序文件夹中删除Podfile.lock文件,并在终端上运行pod install
。
/** Alamofire.podspec **/
...
s.ios.deployment_target = '10.0'
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '3.0'
s.swift_versions = ['5.0', '5.1']
...