Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install Pods on iOS (React Native) #582

Closed
paschaldev opened this issue Oct 13, 2019 · 5 comments
Closed

Unable to install Pods on iOS (React Native) #582

paschaldev opened this issue Oct 13, 2019 · 5 comments

Comments

@paschaldev
Copy link

🐛 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

@paschaldev
Copy link
Author

Sorry, my fault for not reading instructions. It was resolved with pod repo update

@aleclarson
Copy link

@paschaldev What instructions? I tried pod repo update but pod install still fails.

Analyzing dependencies
Fetching podspec for `Flipper` from `../Flipper.podspec`
[!] CocoaPods could not find compatible versions for pod "Flipper-RSocket":
  In Podfile:
    Flipper (from `../Flipper.podspec`) was resolved to 0.29.3, which depends on
      Flipper-RSocket (~> 1.0)

    Flipper-RSocket (~> 0.10)

Specs satisfying the `Flipper-RSocket (~> 0.10), Flipper-RSocket (~> 1.0)` dependency were found, but they required a higher minimum deployment target.
  • Flipper v0.29.3

@paschaldev
Copy link
Author

@aleclarson You can try updating your cocoapods binary to the latest then run pod repo update again.

@kunkun-s
Copy link

错误原因:你的Podfile中的platform要>=依赖库指定的platform
解决:
1.可以删除你工程下的Podfile中的platform。
2.也可以修改你工程下的Podfile中的platform为依赖库的platform相同

@mweststrate
Copy link
Contributor

Don't commend on issues closed for two years.... .

@facebook facebook locked and limited conversation to collaborators Sep 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants