'Pod install fails?

I am running

pod install

Installing DoubleConversion (1.1.6)

[!] Error installing 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

Cloning into '/var/folders/b4/0h5z4ll13k30c3dq47jlxqph0000gn/T/d20220420-94085-oe9kq1'... fatal: remote error: The unauthenticated git protocol on port 9418 is no longer supported. Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

Podfile

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

I recently install cocoa pods so I know it's the latest version. Thoughts?



Solution 1:[1]

You may just have some build issues that can be fixed by resetting certain things. This is not a perfect list, but it's what I do when I have things like a Double Conversion error, especially if it seems to have started happening "out of nowhere."

Since this seems to be a pods issue, you could start by removing Pods and reinstalling them:

cd ios
rm -rf Pods
pod install

I would also clean your build folder! enter image description here

Removing node_modules and reinstalling them is also a good option, but it's likely related to Pods! This won't hurt though:

rm -rf node_modules
yarn install // or npm install

Solution 2:[2]

As logs suggest you to to see

https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git for more details.

if you would check that it basically says

"git:// protocol is not supported anymore for unauthenticated GitHub requests"

You would need to check your package.json file and make sure any of the dependencies should not have starting with git:// if there are then convert all of them to the URL starts with https://domain/repo.git or [email protected]:user/repo.git.

I would suggest to convert those to https:// to avoid the hassle of setting up SSH key.

Important Step: do delete node modules folder then yarn/npm install as well then go inside ios project and do pod install. as a precaution we may consider deleting drived data and clean build folder.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Maverick