17 December 2024 Leave a comment Tech-Help
If you’ve recently upgraded to React Native version 0.62 or later and encountered compatibility issues with the CocoaPods dependency “ReactCommon/jscallinvoker”, you’re not alone. This guide will walk you through the steps to resolve this issue effectively.
Understanding the Problem
The error message you might encounter is typically due to CocoaPods not being able to find compatible versions for “ReactCommon/jscallinvoker”. This issue often arises after upgrading React Native or modifying the Podfile.
Solution Steps
For React Native 0.62
-
Open your
Podfile
located in the iOS directory of your project. -
Replace the following line:
pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
with:
pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
-
Delete the
Podfile.lock
and navigate to the iOS directory in your terminal. -
Run
pod install
to update your CocoaPods dependencies.
For React Native 0.63 and Above
-
Open your
Podfile
and replace its content with the following configuration: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 'YourProjectNameTests' do inherit! :complete end use_flipper! post_install do |installer| flipper_post_install(installer) end end
Replace
YourProjectName
with the actual name of your project. -
Navigate to the iOS directory in your terminal and run
pod install
.
Additional Considerations
It’s important to note that React Native version 0.63 has dropped support for iOS 9. Ensure your platform
line in the Podfile specifies iOS 10 or later.
Enhancing Your Testing Workflow with Repeato
As you work on optimizing your React Native project, consider integrating automated testing to streamline your development process. Repeato, a no-code test automation tool, is designed for iOS and Android applications, allowing you to create, run, and maintain tests with ease. Leveraging computer vision and AI, Repeato simplifies the testing of React Native apps, ensuring that your solutions work seamlessly across devices.
For more insights on React Native development and testing, explore our React Native Testing Guide.