Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find a specification for "React-Codegen"

I'm trying to upgrade an inherited project from React Native 0.64 to 0.68. I'm encountering a number of Cocoapod related errors, particularly around React-Codegen which no longer exists as a podspec in the react-native npm package.

The strange thing is I can't any reference online to others having this problem with this particular podspec. This usually means there is something else wrong for which this is a "red herring".

Below is a subset of my Podfile. I'm wondering whether setup has changed such that I no longer need all of these pod dependencies to be explicitly declared? Anyone have any ideas?

  pod 'React', :path => '../node_modules/react-native/', :modular_headers => false
  pod 'React-Core', :path => '../node_modules/react-native/', :modular_headers => false
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules', :modular_headers => false
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/', :modular_headers => false
  pod 'React-perflogger', :path => "../node_modules/react-native/ReactCommon/reactperflogger", :modular_headers => false # dep for DevSupport
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS', :modular_headers => false
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation', :modular_headers => false
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob', :modular_headers => false
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image', :modular_headers => false
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS', :modular_headers => false
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network', :modular_headers => false
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings', :modular_headers => false
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text', :modular_headers => false
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration', :modular_headers => false
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/', :modular_headers => false
  pod 'React-ART', :path => '../node_modules/react-native/Libraries/ART', :modular_headers => false  # No longer a pod

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact', :modular_headers => false 
like image 529
Hari Honor Avatar asked Mar 14 '26 23:03

Hari Honor


1 Answers

Add the below statement at the top of your application's Podfile:

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

The file which we are requiring in the above step defines a method called use_react_native! which we need in the next step.

Now call the method use_react_native! just before your application's target name in the Podfile as below:

use_react_native! 
target 'Example' do
...
end

Finally, run the command pod install at the root of your application

$ pod install
like image 133
bdiallo Avatar answered Mar 16 '26 12:03

bdiallo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!