无论我做什么,pod update 都不会更新到最新版本的 pod

pod update will not update to latest version of pod no matter what I do

我查看了相关的 Stack Overflow 问题并尝试了那里的建议以及 cocoapods 的 github 问题。

我管理 TensorIOTensorFlow pod,最近发布了该 pod 的两个更新,1.15 和 1.15.1。两个版本都标记在 GitHub 上,并在使用项目根目录中的 pod trunk push TensorIOTensorFlow.podspec linting 后推送到主干。

https://github.com/doc-ai/tensorio-tensorflow-ios

距离我发布1.15.1更新已经十二个多小时了,无论我做什么我都无法pod update将本地项目从1.15版本更新到1.15.1版本或 pod install 安装 1.15 版本以外的任何版本。

我已经尝试清除 cocoapods 缓存:

$ rm -rf "${HOME}/Library/Caches/CocoaPods"
$ rm -rf ~/.cocoapods/repos
$ pod cache clean --all

我已尝试更新我的本地规范存储库:

$ pod install --repo-update
$ pod update --repo-update
$ pod repo update

在删除项目的 Pods 目录和 Podfile.lock 后,我尝试了 pod updatepod install。我已经在一个现有项目和一个新项目中以及在一台单独的机器上尝试了这两种方法,并首次安装了 cocoapods。

我已经尝试在 pod 文件中专门针对该版本:

pod 'TensorIOTensorFlow', '1.15.1'

只得到如下错误:

[!] CocoaPods could not find compatible versions for pod "TensorIOTensorFlow":
  In Podfile:
    TensorIOTensorFlow (= 1.15.1)

None of your spec sources contain a spec satisfying the dependency: `TensorIOTensorFlow (= 1.15.1)`.

You have either:
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

尽管有那个错误,而且特别令人沮丧,trunk 似乎知道 1.15.1 版本:

$ pod trunk info TensorIOTensorFlow

TensorIOTensorFlow
    - Versions:
      - 0.1.0 (2019-04-09 19:29:30 UTC)
      - 0.1.1 (2019-05-09 17:43:06 UTC)
      - 0.3.0 (2019-12-18 18:44:18 UTC)
      - 0.3.1 (2020-01-23 23:36:35 UTC)
      - 1.13.4 (2020-05-01 21:16:32 UTC)
      - 1.13.5 (2020-05-08 21:13:09 UTC)
      - 1.13.6 (2020-05-26 20:05:09 UTC)
      - 1.15 (2020-05-27 17:06:58 UTC)
      - 1.15.1 (2020-05-27 23:44:11 UTC)

但是pod search没有看到:

$ pod search TensorIOTensorFlow

-> TensorIOTensorFlow (1.15)
   The TensorFlow (unofficial) build used by TensorIO for iOS.
   pod 'TensorIOTensorFlow', '~> 1.15'
   - Homepage: https://github.com/doc-ai/tensorio-tensorflow-ios
   - Source:   https://storage.googleapis.com/tensorio-build/r1.15/TensorIO-TensorFlow-1.15_0.tar.gz
   - Versions: 1.15, 1.13.6, 1.13.5, 1.13.4, 0.3.1, 0.3.0, 0.1.1, 0.1.0 [trunk repo]

可以肯定的是,这是 我用 pod delete 删除了 1.15 和 1.15.1 版本并尝试再次将它们推送到主干。在此之前,pod search 确实 显示了 1.15.1 版本,但我仍然无法获得升级到它的项目。

最后,我尝试卸载并重新安装 cocoapods,正如我提到的,我也在一台新机器上尝试了所有这些,并首次安装了最新版本的 cocoapods,但我仍然无法获得pod 的 1.15.1 版本。

更新 CDN 可能会很慢。要解决并直接从 GitHub 存储库加载,请将 source 'https://github.com/CocoaPods/Specs.git' 添加到 Podfile。

注意会慢很多

更新:现在看来根本原因已解决。参见 https://github.com/CocoaPods/CocoaPods/issues/9826

这是我打开的问题: https://github.com/CocoaPods/CocoaPods/issues/9827

而且,我遵循了@paul-beusterien 的回答。这是一个示例

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'

use_frameworks!

target 'YourTarget' do
  inherit! :search_paths
  # Pods for YourTarget
  pod 'YourPod', '10.3.0'
end

所以我添加了

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

在我的 Podfile 的顶部

谢谢:)

检查 .podspec 是否指向上一个 pod 版本,它可能需要更新版本。