Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

react native - CocoaPods could not find compatible versions for pod "ReactCommon/jscallinvoker":

I just updated to RN v0.62 and running app on iOS gives me following error

!] CocoaPods could not find compatible versions for pod "ReactCommon/jscallinvoker":
  In snapshot (Podfile.lock):
    ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`)

  In Podfile:
    ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`)

None of your spec sources contain a spec satisfying the dependency: `ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`)`.

I deleted all node_modules and did npm i. I also did pod install in iOS directory but the issue persists. I also did pod repo update.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

For React native 0.62 version

So I figure it out

Replace following line in your Podfile

pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"

with

pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"

Edit:

If you have updated to React Native version 0.63

Delete Podfile.lock from iOS folder. Do npm i

Open podfile from iOS folder

Delete everything and copy below contents

require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/react-native/scripts/react_native_pods'

platform :ios, '10.0'

target 'RNTodo' do
  config = use_native_modules!
  use_react_native!(:path => config["reactNativePath"])

  target 'RNTodoTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!
  post_install do |installer|
    flipper_post_install(installer)
  end
end

target 'RNTodo-tvOS' do
  # Pods for RNTodo-tvOS

  target 'RNTodo-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

Replace RNTodo with your own project name, cd to iOS folder in the terminal and do pod install and everything should work

Also RN 0.63 has dropped support for iOS 9


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...