Unable to install Pods on iOS (React Native)
See original GitHub issue🐛 Bug Report
I’ve followed the guidelines for setting up flipper with iOS for React Native, but after running pod install
, it failsw with this error
[!] CocoaPods could not find compatible versions for pod "FlipperKit/SKIOSNetworkPlugin":
In Podfile:
FlipperKit/SKIOSNetworkPlugin (~> 0.25)
None of your spec sources contain a spec satisfying the dependency: `FlipperKit/SKIOSNetworkPlugin (~> 0.25)`.
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
To Reproduce
ios/Podfile
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
def flipper_pods()
flipperkit_version = '0.25'
pod 'FlipperKit', '~>' + flipperkit_version, :configuration => 'Debug'
pod 'FlipperKit/FlipperKitLayoutPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
pod 'FlipperKit/SKIOSNetworkPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
end
# Post Install processing for Flipper
def flipper_post_install(installer)
installer.pods_project.targets.each do |target|
if target.name == 'YogaKit'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
end
file_name = Dir.glob("*.xcodeproj")[0]
app_project = Xcodeproj::Project.open(file_name)
app_project.native_targets.each do |target|
target.build_configurations.each do |config|
cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '
unless cflags.include? '-DFB_SONARKIT_ENABLED=1'
puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'
cflags << '-DFB_SONARKIT_ENABLED=1'
end
config.build_settings['OTHER_CFLAGS'] = cflags
end
app_project.save
end
installer.pods_project.save
end
target 'mhoori' do
# Pods for mhoori
pod 'FBLazyVector', :path => '../node_modules/react-native/Libraries/FBLazyVector'
pod 'FBReactNativeSpec', :path => '../node_modules/react-native/Libraries/FBReactNativeSpec'
pod 'RCTRequired', :path => '../node_modules/react-native/Libraries/RCTRequired'
pod 'RCTTypeSafety', :path => '../node_modules/react-native/Libraries/TypeSafety'
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/jscallinvoker', :path => '../node_modules/react-native/ReactCommon'
pod 'ReactCommon/turbomodule/core', :path => '../node_modules/react-native/ReactCommon'
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
pod 'Firebase/Analytics'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
target 'mhooriTests' do
inherit! :search_paths
# Pods for testing
end
use_native_modules!
# For enabling Flipper.
# Note that if you use_framework!, flipper will no work.
# Disable these lines if you are doing use_framework!
flipper_pods()
post_install do |installer|
flipper_post_install(installer)
end
end
target 'mhoori-tvOS' do
# Pods for mhoori-tvOS
target 'mhoori-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
Expected Behavior
Able to install the pods correctly
Environment
OS: MacOS Mojave React Native: 0.61.2
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
iOS pod install is failing on project init #30690 - GitHub
When running npx react-native init <myproject> , using any template, the pod install phase fails on macOS 11.1 and XCode 12.3.
Read more >How to fix “pod install” error in React Native on Mac M1
sudo gem install cocoapods. to install cocoapods , the standard dependency manager for Swift and Objective-C projects. · npx react-native init AwesomeApp -- ......
Read more >Pod install fails? - react native - Stack Overflow
Important Step: do delete node modules folder then yarn/npm install as well then go inside ios project and do pod install . as...
Read more >Troubleshooting - React Native
Run pod deintegrate in your ios directory (or wherever your Podfile is located) and re-run pod install (or arch -x86_64 pod install ,...
Read more >Trouble with installing cocoapods | Apple Developer Forums
This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry, my fault for not reading instructions. It was resolved with
pod repo update
@paschaldev What instructions? I tried
pod repo update
butpod install
still fails.