【问题标题】:Pod install fails?Pod 安装失败?
【发布时间】:2022-11-09 22:53:13
【问题描述】:

我在跑步

pod install

安装 DoubleConversion (1.1.6)

[!] 安装 DoubleConversion 时出错 [!] /usr/bin/git clone https://github.com/google/double-conversion.git /var/folders/b4/0h5z4ll13k30c3dq47jlxqph0000gn/T/d20220420-94085-oe9kq1 --template= --single-branch --depth 1 --branch v1.1.6

克隆到 '/var/folders/b4/0h5z4ll13k30c3dq47jlxqph0000gn/T/d20220420-94085-oe9kq1'... 致命:远程错误: 不再支持端口 9418 上的未经身份验证的 git 协议。 请参阅https://github.blog/2021-09-01-improving-git-protocol-security-github/ 了解更多信息。

播客文件

require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
require File.join(File.dirname(`node --print "require.resolve('@react-native-community/cli-platform-ios/package.json')"`), "native_modules")

platform :ios, '12.0'

require 'json'
podfile_properties = JSON.parse(File.read('./Podfile.properties.json')) rescue {}

target 'MyAPP' do
  use_expo_modules!
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => podfile_properties['expo.jsEngine'] == 'hermes'
  )

  # Uncomment to opt-in to using Flipper
  #
  # if !ENV['CI']
  #   use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1')
  # end

  post_install do |installer|
    react_native_post_install(installer)

    # Workaround `Cycle inside FBReactNativeSpec` error for react-native 0.64
    # Reference: https://github.com/software-mansion/react-native-screens/issues/842#issuecomment-812543933
    installer.pods_project.targets.each do |target|
      if (target.name&.eql?('FBReactNativeSpec'))
        target.build_phases.each do |build_phase|
          if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
            target.build_phases.move(build_phase, 0)
          end
        end
      end
    end
  end

end

我最近安装了可可豆荚,所以我知道它是最新版本。想法?

【问题讨论】:

  • 我没有看到在我的项目或文件中的任何地方指定了 DoubleConversion。
  • 看起来是网络问题,需要反复安装,耐心等待
  • 您是否尝试过删除 pod 并重新安装它们?意思是删除你的 Pods 文件夹,然后运行 ​​pod install

标签: react-native cocoapods


【解决方案1】:

您可能只是有一些构建问题,可以通过重置某些内容来解决。这不是一个完美的列表,但是当我遇到诸如双重转换错误之类的事情时,我就会这样做,尤其是当它似乎已经开始“突然”发生时。

由于这似乎是一个 pod 问题,您可以从删除 Pod 并重新安装它们开始:

cd ios
rm -rf Pods
pod install

我也会清理你的构建文件夹!

删除 node_modules 并重新安装它们也是一个不错的选择,但它可能与 Pods 有关!不过,这不会受到伤害:

rm -rf node_modules
yarn install // or npm install

【讨论】:

    【解决方案2】:

    日志建议您查看

    https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git 更多细节。

    如果你检查它基本上说

    “未经身份验证的 GitHub 不再支持 git:// 协议 要求”

    您需要检查您的package.json 文件并确保任何依赖项都不应该以git:// 开头,如果有然后将它们全部转换为以https://domain/repo.gitgit@github.com:user/repo.git 开头的URL。

    我建议将它们转换为 https:// 以避免设置 SSH 密钥的麻烦。

    重要步骤:删除节点模块文件夹,然后删除yarn/npm install,然后进入ios项目并执行pod install。 作为预防措施,我们可以考虑deleting drived dataclean build folder

    【讨论】:

      【解决方案3】:

      在执行 pod install 之前,您是否尝试过 sudo gem install cocoapods?

      【讨论】:

        猜你喜欢
        • 2021-01-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-12-22
        • 2021-01-28
        • 2017-10-06
        • 1970-01-01
        相关资源
        最近更新 更多