147

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.

13 Answers 13

375

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

7
  • How to solve this problem permanently? Is it a problem from ReactNative team?
    – Satyam
    May 22, 2020 at 11:31
  • 3
    Note: projects ejected from Expo will show the path as "#{rnPrefix}/ReactCommon" so, for clarity, the only change is "/jscallinvoker" to "/callinvoker" in the pod name Jun 29, 2020 at 19:48
  • 4
    Thank you for adding the edit for React Native 0.63! Jul 22, 2020 at 0:43
  • This worked fantastic, on react native 0.63, thanks
    – cherucole
    Aug 4, 2020 at 22:26
  • 2
    I received the error [!] Invalid 'Podfile' file: undefined method '[]' for nil:NilClass. but fixed it by changing the following line, from use_react_native!(:path => config["reactNativePath"]) to use_react_native! Sep 18, 2020 at 16:29
70

I solved this issue (version 0.63) by changing the line in the Podfile from

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

to

pod 'React-callinvoker', :path => "../node_modules/react-native/ReactCommon/callinvoker"
5
  • This cause - [!] No podspec found for React-callinvoker in ../node_modules/react-native/ReactCommon
    – Piotrek
    Jul 14, 2020 at 16:05
  • sorry @PiotrPiątkiewicz was wrong on the react version, I'm on 0.63 Jul 15, 2020 at 8:26
  • this solved my update issue when going from 62 to 63 - thanks!
    – Adam
    Dec 12, 2020 at 15:39
  • Thanks! This solved the problem for me after upgrading RN from 0.61.5 to 0.63.4 Jan 22, 2021 at 7:18
  • Rocket science! Feb 19, 2021 at 4:40
38

I think jscallinvoker version is deprecated try to replacing

jscallinvoker 

to

callinvoker
1
  • 2
    fyi all, this worked for me when updating expo to 38 Jul 20, 2020 at 20:52
33

RN 0.63 has dropped support for iOS 9

So in pod file replace

  • platform :ios, '9.0'*
  • platform :ios, '10.0'*

and

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

go to the ios folder in the terminal run

  • pod install
  • run react-native run-ios
1
  • 2
    Keep single quotes instead of double quotes if your Podfile uses just single ones. Thank you Jan 14, 2021 at 1:19
16

On Upgrade to React Native 0.63.0

This issue happens to my project after upgrading React Native to version 0.63.0 so for the solution I just remove the Podfile.lock and delete whole the Podfile and add the new content from a fresh install React Native project on the latest version and it means its content should be:

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 '[YourProjectName]' do
  config = use_native_modules!
  use_react_native!(:path => config["reactNativePath"])

  target '[YourProjectName]Tests' 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 '[YourProjectName]-tvOS' do
  # Pods for [YourProjectName]-tvOS

  target '[YourProjectName]-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

Note: it is obvious you should replace your project name with [YourProjectName].

After it, run npx pod-install command on the root of your project and everything will back on track.

2
  • 3
    [!] Unable to find a target named MyRNTests` in project MyRNApp.xcodeproj, did find MyRNApp.`
    – Kasra
    Sep 11, 2020 at 20:07
  • The error shows you which targets to leave in your file - did find MyRNApp. So remove all the other targets [MyRNTests, YourProjectName-tvOS, YourProjectName-tvOSTests] and any others you don't have in your setup. Basically, remove any other that doesn't appear in the 'did find' of the error message.
    – kakoma
    Dec 16, 2020 at 20:42
11

In case anyone is still having issues with React Native Version 0.63.0 then this worked for me

Updating the callinvoker pod as follows

pod 'React-callinvoker', :path => "#{rnPrefix}/ReactCommon/callinvoker"
2
  • 1
    For anyone wants to try this and gets an undefined variable declaration for rnPrefix, make sure to declare rnPrefix to whatever the path in node_modules is to react-native. For example - "../node_modules/react-native" Jul 24, 2020 at 15:21
  • 1
    Thank you, this should be higher up, the other solutions caused other problems for me
    – Sam
    Aug 29, 2020 at 7:22
9

In RN 0.63.0 you can remove all RN pods from you podfile and just include the following lines inside the target.

config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])

Also this line needs to be added after the platform line at the beginning of the podfile:

require_relative '../node_modules/react-native/scripts/react_native_pods'

After this, delete the Pods directory, Podfile.lock and the workspace file. Then just pod install.

1
  • Would appreciate more information about the entire podfile layout
    – Dazzle
    Aug 14, 2020 at 21:43
8

React-Native is now configuring pods dynamically, so you don't need to list each one anymore;

use_react_native!(:path => config["reactNativePath"])

This is what you get from a 63.1 base Podfile:

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

platform :ios, '10.0'

target 'test' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  target 'testTests' do
    inherit! :complete
  end


  use_flipper!
  post_install do |installer|
    flipper_post_install(installer)
  end
end

target 'test-tvOS' do

  target 'test-tvOSTests' do
    inherit! :search_paths
  end
end
1
  • Very simple fix and works as advertised. Thank you!
    – Yacine B
    Jul 27, 2020 at 18:55
3

Making manual adjustments according to https://react-native-community.github.io/upgrade-helper/?from=0.62.2&to=0.63.2 might help.

You will then have to run the command cd ios && pod install.

3
platform :ios, '11.0'

I solved this issue (version 0.63.4) by changing as below

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

# Maybe someone is

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


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

In case you already had callinvoker but you still have an error. This manipulation helped me :

 react-native start --reset-cache
 rm -rf node_modules/
 rm -rf package-lock.json 
 cd ios
 pod deintegrate
 cd ..
 rm -rf ios/Podfile.lock 
 npm install
 npm audit fix
 react-native link
 cd ios
 pod install
 cd ..
 react-native run-ios
2

Faced this issue while upgrading Expo bare workflow 0.38 (RN 0.62) to 0.39 (has RN 0.63). Edited answer of @Pritish did work, But it says this error

[!] Unable to find a target named `RNTodo-tvOS` in project `RNTodo.xcodeproj`, did find `RNTodo`.

And

[!] Unable to find a target named `RNTodoTests` in project `RNTodo.xcodeproj`, did find `RNTodo`.

Got workaround by changing Podfile like below

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

platform :ios, '10.0'

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

  # 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

What changed?

ADD unimodules at top

require_relative '../node_modules/react-native-unimodules/cocoapods.rb'

ADD use_unimodules! before config = use_native_modules!.

REMOVE

target '[YourProjectName]Tests' do
    inherit! :complete
    # Pods for testing
  end

REMOVE

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

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

For Android (If you are getting errors after upgrading)

In android/build.gradle Change

ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 21
        compileSdkVersion = 28
        targetSdkVersion = 28
    }

To

ext {
        buildToolsVersion = "29.0.2"
        minSdkVersion = 21
        compileSdkVersion = 29
        targetSdkVersion = 29
    }
1
  • 1
    Thanks @lakshmeesha, I had to do this as well coming from expo. In my case I also had to add use_unimodules!(modules_paths: ['../../node_modules']) so expo could find react-native-unimodules up a folder (I use yarn workspaces and my expo project is a folder below the root). Sep 22, 2020 at 20:56
1

if you have upgraded react native to 0.65+, you need to do a change in podfile

platform :ios, '10.0'

to

platform :ios, '11.0'

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.