【问题标题】:pod update will not update to latest version of pod no matter what I do无论我做什么,pod update 都不会更新到最新版本的 pod
【发布时间】:2020-09-16 03:49:15
【问题描述】:

我查看了相关的 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,但我仍然无法获得 1.15 .1 版本的 pod。

【问题讨论】:

  • 您可以尝试暂时固定到提交 pod 'TensorIOTensorFlow', :git => 'https://github.com/doc-ai/tensorio-tensorflow-ios.git', :commit => ' 16f906b'
  • @LouFranco 谢谢,是的,这确实可以作为一种解决方法。我还可以使用 :tag => '1.15.1' 来定位该版本。

标签: ios cocoapods


【解决方案1】:

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

请注意,它会慢得多。

更新:现在看来根本原因已经修复。见https://github.com/CocoaPods/CocoaPods/issues/9826

【讨论】:

  • 谢谢@paul-beusterien,是的,这确实有效。那么这真的是一个观望的问题吗?我以前在使用 cocoapods 时遇到过一些延迟,但如果是这样的话,我从来没有超过一个小时。
  • 是的 - CDN 通常会在 10 分钟左右更新,因此今天可能会发生一些不寻常的事情
  • 看起来 CDN 终于更新了,在 pod repo update 之后 pod update 正确抓取了 1.15.1
【解决方案2】:

这是我打开的问题: 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 的顶部

谢谢:)

【讨论】:

    【解决方案3】:

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

    【讨论】:

      猜你喜欢
      • 2016-02-26
      • 1970-01-01
      • 2023-03-19
      • 2011-04-26
      • 1970-01-01
      • 2018-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多