Use use_frameworks! on a reactnative project - ios

My podfile cotains static library from reactnative on node_modules and also third-party-podspecs like Folly.podspec, glog.podspec, DoubleConversion.podspec and a dynamic swift library
when i try to excecute the projet i have errors with third-party-podspecs
double-conversion/double-conversion.h' file not found
here is my podfile :
platform :ios, '10.0'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
#sdk id libs
source 'https://gitlab-repoxxxxxxxf.fr/dosn/xxxx.git'
source 'https://github.com/CocoaPods/Specs.git'
target 'MyProject' do
use_frameworks!
# Pods for DigiDrive
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/React'
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'react-native-simple-toast', :path => '../node_modules/react-native-simple-toast'
#sdk id libs
pod 'IMPORTANTLIB'
target 'MyProjectTests' do
inherit! :search_paths
# Pods for testing
end
use_native_modules!
end
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method,
:verify_no_static_framework_transitive_dependencies) {}
end
target 'MyProject-tvOS' do
# Pods for DigiDrive-tvOS
target 'MyProject-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
How can i resolve this problem ?

I just do more search and i understand that react native 0.60 version doesn't support use of use_frameworks!, so i had to pass to the last react native version : 0.63.0 but the problem is that several version of libs has to be changed on reactNative

Related

Can't pod install firebase. This error occurs: No podspec found for `RNFirebase`

I run pod install in src/ios/ directory and it says this:
No podspec found for `RNFirebase` in `../node_modules/react-native-firebase`
The thing is that it worked before, now it doesn't and I don't know why really.
This is my Podfile:
platform :ios, '11.0'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
target '<App_Name>' do
# Pods for <App_Name>
pod 'Firebase/Core', '~> 6.13.0'
pod 'Firebase/Messaging', '~> 6.13.0'
pod 'Firebase/Analytics'
# Required by RNFirebase v5 Crashlytics
pod 'Fabric', '~> 1.9.0'
pod 'Crashlytics', '~> 3.12.0'
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'Firebase/DynamicLinks', '~> 6.13.0'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'RNAppleAuthentication', :path => '../node_modules/#invertase/react-native-apple-authentication'
pod 'RNCPicker', :path => '../node_modules/#react-native-community/picker'
pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
pod 'RNGoogleSignin', :path => '../node_modules/react-native-google-signin'
pod 'react-native-ibm-mobilefirst', :path => '../node_modules/react-native-ibm-mobilefirst'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'react-native-google-maps', path: '../node_modules/react-native-maps' # <~~ if you need GoogleMaps support on iOS
pod 'GoogleMaps' # Uncomment this line if you want to support GoogleMaps on iOS
pod 'Google-Maps-iOS-Utils' # Uncomment this line if you want to support GoogleMaps on iOS
# pod 'RNFirebase/Crashlytics', :path => '../node_modules/react-native-firebase/ios'
pod 'lottie-ios', :path => '../node_modules/lottie-ios'
pod 'Firebase/Auth', '~> 6.13.0'
pod 'RNFastImage', :path => '../node_modules/react-native-fast-image'
pod 'ReactNativeNavigation', :path => '../node_modules/react-native-navigation'
pod 'react-native-geolocation-service', :path => '../node_modules/react-native-geolocation-service'
pod 'lottie-react-native', :path => '../node_modules/lottie-react-native'
pod 'react-native-webview', :path => '../node_modules/react-native-webview'
pod 'RNInAppBrowser', :path => '../node_modules/react-native-inappbrowser-reborn'
pod 'react-native-maps', :path => '../node_modules/react-native-maps'
pod 'RNCAsyncStorage', :path => '../node_modules/#react-native-community/async-storage'
pod 'react-native-netinfo', :path => '../node_modules/#react-native-community/netinfo'
pod 'react-native-geolocation', :path => '../node_modules/#react-native-community/geolocation'
pod 'RNFirebase', :path => '../node_modules/react-native-firebase'
target '<App_Name>Tests' do
inherit! :search_paths
# Pods for testing
end
post_install do |installer|
## Fix for XCode 12.5 beta
find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
"_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules")
find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm",
"RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass(Class(module)))")
end
# use_native_modules!
end
target '<App_Name>-tvOS' do
# Pods for <App_Name>-tvOS
target '<App_Name>-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
def find_and_replace(dir, findstr, replacestr)
Dir[dir].each do |name|
text = File.read(name)
replace = text.gsub(findstr,replacestr)
if text != replace
puts "Fix: " + name
File.open(name, "w") { |file| file.puts replace }
STDOUT.flush
end
end
Dir[dir + '*/'].each(&method(:find_and_replace))
end
As you can see down there, I have:
pod 'RNFirebase', :path => '../node_modules/react-native-firebase'
If I add /ios to the end there, the pod install will work but then it can't build it in Xcode.
I tried many solutions, nothing worked for me.
I tried deintegrate Cocoapods and pod install after that.
I tried deleting node_modules folder and then install again.
Also tried deleting Pods folder as well as the Podfile and Podfile.lock and then installing them again. Nothing worked.
I use Ventura. Xcode 14.
Check that path ../node_modules/react-native-firebase, keep in mind it's a relative path, so should start from the folder where is your Podfile file.
Also in that folder ../node_modules/react-native-firebase should be file with extension .podspec
Please add this import in AppDelegate file:
#import <Firebase.h>
Just add /ios to the end of the path, like this:
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'

use_framework vs use_native_modules

I do not use use_frameworks and use_native_modules in my podfile. It runs as usual when I enable use_native_modules, but build fail when I use use_frameworks.
I've read to understand what use_frameworks for but I'm not aware of the differences between this two.
platform :ios, '8.0'
use_frameworks!
target "CityWhether" do
pod 'Alamofire'
pod 'SwiftyJSON'
use_native_modules!
end
Guess I have understand both the difference (please correct me if my understanding is incorrect),
For use_frameworks! please read here as it has already describe what it's for.
For use_native_modules!, it's actually being use in React Native 0.60 and above for auto-linking. With the command specified in podfile, all the new dependency appended to project do not require developer to append new dependency's podspec into podfile. It will link automatically when you run pod install command.
I have been appending all the podspecs myself ever since I upgraded to RN0.60 😅
Sample podfile
platform :ios, '9.0'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
target 'example' do
# Pods for example
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
target 'exampleTests' do
inherit! :search_paths
# Pods for testing
end
use_native_modules!
end
target 'example-tvOS' do
# Pods for example-tvOS
target 'example-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
the header file search way maybe has been changed, so you can not build sucess

My react native encountered a problem while building tvOS but iOS succeeded

I followed the link below to install new reactNative App ..
https://facebook.github.io/react-native/docs/getting-started
After Successfully Installed I am able to run the iOS target but not tvOS while running tvOS I am getting below error ..
Library not found for -lPods-AwesomeProject-tvOS
It seems in podfile cocoapods not included for tvos target .. So I added cocoaPods for tvos target and then build again but getting below warning and errors..
I am also adding my Podfile here please suggest any changes
# Pods for ReactNativeSample
platform :ios, '9.0'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
target 'ReactNativeSampleTests' do
inherit! :search_paths
# Pods for testing
end
use_native_modules!
end
target 'ReactNativeSample-tvOS' do
# Pods for ReactNativeSample-tvOS
platform :tvos, '9.2'
All same pods in above target included here as well..
target 'ReactNativeSample-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end ```

No podspec found for `React-Core` in `../node_modules/react-native/React`

I'm using React Native. I get this issue when I try to upload pods. I've successfully installed node_modules, but I'm getting this problem. What is the problem? If we delete the package-lock.json and node_modules folder, I reinstalled npm. But I'm having this problem when I'm doing pod install.
platform :ios, '9.0'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
target '...' do
# use_frameworks!
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/React'
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
# Required by RNFirebase
pod 'Firebase/Core', '~> 6.8.1'
# [OPTIONAL PODS] - comment out pods for firebase products you won't be using.
# pod 'Firebase/AdMob', '~> 6.8.1'
pod 'Firebase/Auth', '~> 6.8.1'
pod 'Firebase/Database', '~> 6.8.1'
pod 'Firebase/Functions', '~> 6.8.1'
pod 'Firebase/DynamicLinks', '~> 6.8.1'
pod 'Firebase/Firestore', '~> 6.8.1'
pod 'Firebase/Messaging', '~> 6.8.1'
pod 'Firebase/RemoteConfig', '~> 6.8.1'
pod 'Firebase/Storage', '~> 6.8.1'
pod 'Firebase/Performance', '~> 6.8.1'
pod 'Fabric', '~> 1.10.2'
pod 'Crashlytics', '~> 3.14.0'
target '..' do
inherit! :search_paths
# Pods for testing
end
use_native_modules!
end
target '...-tvOS' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for ..-tvOS
target 'DeliveryApp-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
Podspec was moved from
../node_modules/react-native/React
to
../node_modules/react-native
So update the line
pod 'React-Core', :path => '../node_modules/react-native/React'
to
pod 'React-Core', :path => '../node_modules/react-native'
Please check it here depend on your react-native version
https://react-native-community.github.io/upgrade-helper/?from=0.60.6&to=0.61.4
This error occurred as Podspec was moved to
../node_modules/react-native
In order to solve this issue paste the following code in your Podfile. inside your target
# Pods for RnDiffApp
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
I've taken reference from RnDiffApp/ios/Podfile
Make sure not to remove your existing added modules in Podfile.
You should upgrade React Native using react-native upgrade, but check if all pods necessary to your React Native version are in Podfile when upgrading without this tool (sometimes with it too).
One good tool to check Podfile is the Upgrade-helper. For example, if you upgrade RN from 0.60.6 to 0.61.4, RN pod dependencies will be significantly different in Podfile:
# React Native pod dependencies
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
I was running
pod install
inside ios Directory when I encounter this error for different dependency. I forgot to run
npm install
After running this command then pod install. I was able to successfully run the project.
Hey guys this updated pod file save my day.
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
target 'Native_iOS_App' do
use_frameworks!
config = use_native_modules!
use_react_native!(:path => config["../node_modules/react-native"])
end
Eric's answer is probably the root cause of the problem, using an RN Podfile layout from a previous/different version of RN. I got the same error when moving from 0.62 to 0.63.
For people going from 0.62 to 0.63, the upgrade helper shows that the very verbose RN Podfile boilerplate that Eric cites is now more succinct (see Som's response - although there are a few more changes).
Personally, I created a fresh react-native project with 0.63 and compared it to what I had. If I had known about the upgrade helper I would have used that instead.
I faced this issue with React-Native 0.62.2. My package location was incorrect.
Change this
pod 'RNCAsyncStorage', :path => '../node_modules/#react-native-community/async-storage'
To this
pod 'RNCAsyncStorage', :path => '../node_modules/#react-native-async-storage/async-storage'

Generate Pod files issue after updating the react native version 0.59 to 0.60

I have updated the react-native version 0.59.9 to 0.60.5.
Before version:
"react": "16.8.3",
"react-native": "0.59.9",
After updating the version:
"react": "16.8.6",
"react-native": "0.60.5",
After updating the version, in iOS directory, can not see the pod file.
So I have run the following command to generate the pod file.
pod init
pod install
After applying the command I can see my pod file like below.
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Base' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for Base
target 'BaseTests' do
inherit! :search_paths
# Pods for testing
end
end
But when we create a new project then we can get following pod file by default with pods.
platform :ios, '9.0'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
target 'Temp' do
# Pods for Temp
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/React'
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
target 'TempTests' do
inherit! :search_paths
# Pods for testing
end
use_native_modules!
end
target 'Temp-tvOS' do
# Pods for Temp-tvOS
target 'Temp-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
So, If I want to create the pod file after updating the version of react-native then, How can we create the pod file like default one?

Resources