-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
cocoapods integration error: undefined local variable or method `min_supported_versions' #45889
Comments
|
|
I want to kindly point out that I checked the file located at While I understand that manually setting This issue still occurs in version 0.74.4. |
Hi @ziggear can you share your full Podfile? |
Thanks @cipolleschi ! My Podfile is really simple because I just started a new project and tried to use the newest React Native other than the version Thank you very much for your reminder about the Here is the full version of my project's Podfile: platform :ios, "13.0"
target :iOSKeyboardDemo do
pod 'CocoaAsyncSocket'
pod 'LocalSocket', :path => './LocalSocket/'
pod 'FBLazyVector', :path => "./RN/node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "./RN/node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "./RN/node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "./RN/node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => './RN/node_modules/react-native/'
pod 'React-Core', :path => './RN/node_modules/react-native/'
pod 'React-CoreModules', :path => './RN/node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => './RN/node_modules/react-native/'
pod 'React-RCTActionSheet', :path => './RN/node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => './RN/node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => './RN/node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => './RN/node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => './RN/node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => './RN/node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => './RN/node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => './RN/node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => './RN/node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => './RN/node_modules/react-native/'
pod 'React-cxxreact', :path => './RN/node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => './RN/node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => './RN/node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => './RN/node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/callinvoker', :path => "./RN/node_modules/react-native/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "./RN/node_modules/react-native/ReactCommon"
pod 'Yoga', :path => './RN/node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => './RN/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => './RN/node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => './RN/node_modules/react-native/third-party-podspecs/Folly.podspec'
end
target :KeyboardExtension do
pod 'CocoaAsyncSocket'
pod 'LocalSocket', :path => './LocalSocket/'
end |
@ziggear Your Podfile should look something like this: # Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
platform :ios, min_ios_version_supported
prepare_react_native_project!
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
target 'NativeExample' do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
:app_path => "#{Pod::Config.instance.installation_root}/../.."
)
post_install do |installer|
# https://github.com/facebook/react-native/blob/main/packages/ react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
)
end
end You can check out an example of brownfield integration for both Swift and Objective-C in this repo: https://github.com/callstack/react-native-brownfield/tree/master/example/objc |
Thanks @okwasniewski it works for me! By the way I believe this could be a documentation issue for the Objective-C developer to integrate initially newest react native to their project: the documentation still suggest to add pods explicitly: |
The documentation on this topic is unfortunately outdated. I'm happy that you managed to get it working |
Description
Followed instructions in React Native's official document - Environment Setup - Integration with existing apps, installed react native 0.74.0 and react 18.2.0, then add some react native's pod to my Podfile, error occurred after
pod install
command.Steps to reproduce
npm install react-native@0.74.0 && npm install react@18.2.0
pod install
React Native Version
0.74.0
Affected Platforms
Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/ziggear/ZiggearRNReproducer/tree/main
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: