react-native - Pod 安装卡在克隆规范 repo
Posted
技术标签:
【中文标题】react-native - Pod 安装卡在克隆规范 repo【英文标题】:react-native - Pod install stucked at cloning spec repo 【发布时间】:2020-04-10 18:12:53 【问题描述】:突然间,当我尝试将新 pod 添加到 Podfile 并尝试安装它们时,过程变得无限! 这是我的 Podfile:
# Podfile content
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'MyProject' do
# React Native
rn_path = '../node_modules/react-native'
rn_maps_path = '../node_modules/react-native-maps'
pod 'yoga', :path => "#rn_path/ReactCommon/yoga"
pod 'RNSVG', :path => '../node_modules/react-native-svg'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'React', path: "#rn_path", :subspecs => [
'Core',
'CxxBridge',
'RCTActionSheet',
'RCTAnimation',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket',
'DevSupport'
]
pod 'DoubleConversion', :podspec => "#rn_path/third-party-podspecs/DoubleConversion.podspec"
pod 'glog', :podspec => "#rn_path/third-party-podspecs/glog.podspec"
pod 'Folly', :podspec => "#rn_path/third-party-podspecs/Folly.podspec"
# Required by Google Map, ignore if you use Apple Map
pod 'GoogleMaps', '2.5.0'
pod 'Google-Maps-iOS-Utils', '2.1.0'
pod 'GoogleUtilities', '5.3.7'
pod 'GoogleAppMeasurement', '5.4'
pod 'react-native-maps', path: rn_maps_path
pod 'react-native-google-maps', path: rn_maps_path # <~~ if you need GoogleMaps support on iOS
pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'
pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
pod 'RNKeychain', :path => '../node_modules/react-native-keychain'
pod 'RNSecureRandom', :path => '../node_modules/react-native-securerandom'
pod 'RNShare', :path => '../node_modules/react-native-share'
pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
pod 'react-native-image-resizer', :path => '../node_modules/react-native-image-resizer'
pod 'RNFS', :path => '../node_modules/react-native-fs'
pod 'RNScrypt', :path => '../node_modules/react-native-scrypt'
pod 'react-native-randombytes', :path => '../node_modules/react-native-randombytes'
pod 'RNOS', :path => '../node_modules/react-native-os'
pod 'TcpSockets', :path => '../node_modules/react-native-tcp'
pod 'react-native-udp', :path => '../node_modules/react-native-udp'
pod 'react-native-aes', :path => '../node_modules/react-native-aes-crypto'
pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app'
pod 'RNFBMessaging', :path => '../node_modules/@react-native-firebase/messaging'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "react-native-google-maps"
target.build_configurations.each do |config|
config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
end
end
if target.name == "React"
target.remove_from_project
end
targets_to_ignore = %w(React yoga)
if targets_to_ignore.include? target.name
target.remove_from_project
end
end
end
这是日志:
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-MyProject`: (``)
Fetching external sources
-> Fetching podspec for `BVLinearGradient` from `../node_modules/react-native-linear-gradient`
-> Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
-> Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
-> Fetching podspec for `RNCAsyncStorage` from `../node_modules/@react-native-community/async-storage`
-> Fetching podspec for `RNDeviceInfo` from `../node_modules/react-native-device-info`
-> Fetching podspec for `RNFBApp` from `../node_modules/@react-native-firebase/app`
-> Fetching podspec for `RNFBMessaging` from `../node_modules/@react-native-firebase/messaging`
-> Fetching podspec for `RNFS` from `../node_modules/react-native-fs`
-> Fetching podspec for `RNKeychain` from `../node_modules/react-native-keychain`
-> Fetching podspec for `RNOS` from `../node_modules/react-native-os`
-> Fetching podspec for `RNSVG` from `../node_modules/react-native-svg`
-> Fetching podspec for `RNScrypt` from `../node_modules/react-native-scrypt`
-> Fetching podspec for `RNSecureRandom` from `../node_modules/react-native-securerandom`
-> Fetching podspec for `RNShare` from `../node_modules/react-native-share`
-> Fetching podspec for `RNVectorIcons` from `../node_modules/react-native-vector-icons`
-> Fetching podspec for `React` from `../node_modules/react-native`
-> Fetching podspec for `TcpSockets` from `../node_modules/react-native-tcp`
-> Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
-> Fetching podspec for `react-native-aes` from `../node_modules/react-native-aes-crypto`
-> Fetching podspec for `react-native-google-maps` from `../node_modules/react-native-maps`
-> Fetching podspec for `react-native-image-picker` from `../node_modules/react-native-image-picker`
-> Fetching podspec for `react-native-image-resizer` from `../node_modules/react-native-image-resizer`
-> Fetching podspec for `react-native-maps` from `../node_modules/react-native-maps`
-> Fetching podspec for `react-native-randombytes` from `../node_modules/react-native-randombytes`
-> Fetching podspec for `react-native-udp` from `../node_modules/react-native-udp`
-> Fetching podspec for `yoga` from `../node_modules/react-native/ReactCommon/yoga`
Resolving dependencies of `Podfile`
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because
checking is only perfomed in repo update
Cloning spec repo `cocoapods` from `https://github.com/CocoaPods/Specs.git`
$ /usr/bin/git clone https://github.com/CocoaPods/Specs.git -- cocoapods
Cloning into 'cocoapods'...
它卡在这里,当我检查活动指示器时,一个名为 git-remote-https
的进程正在不断地从 repo 中获取源代码,但它也没有结束!为什么这样??如何解决它
【问题讨论】:
你是否改变了 pod 文件中的任何内容? @WaheedAkhtar 我已经编辑并添加了我的 podfile。 你新添加了什么依赖? @WaheedAkhtar react-native-firebase 包 【参考方案1】:改变
source 'https://github.com/CocoaPods/Specs.git'
到
source 'https://cdn.cocoapods.org/'
请注意,这需要 CocoaPods 1.8.0 或更高版本。见pod --version
【讨论】:
如何改源?? 这是粘贴在问题中的 Podfile 的第 2 行。 哎呀!是的。。我很困惑。谢谢老兄。以上是关于react-native - Pod 安装卡在克隆规范 repo的主要内容,如果未能解决你的问题,请参考以下文章
React-native iOS 不显示图像(pod 问题)
Cocoapods “pod install”卡在 OS X El Capitan 上
React-Native 项目卡在 :app:installDebug
来自 StatefulSet 的 Pod 卡在 ContainerCreating 状态 - FailedCreatePodSandBox