Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios CocoaPods找不到pod的兼容版本;阿拉莫菲尔5.0.0-rc.2“;_Ios_Swift_Cocoapods_Alamofire - Fatal编程技术网

Ios CocoaPods找不到pod的兼容版本;阿拉莫菲尔5.0.0-rc.2“;

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'

我在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'

因为该版本是新的(仅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']
...