Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found - react-native

App get crashed with the above message. Unable to view my app screen.
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the na..., stack:
platform :ios, '9.0'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
target 'App' do
# Pods for App
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
#pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
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 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
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'
pod 'react-native-cameraroll', :path => '../node_modules/#react-native-community/cameraroll'
target 'AppTests' do
inherit! :search_paths
# Pods for testing
end
use_native_modules!
end
target 'App-tvOS' do
# Pods for App-tvOS
target 'App-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end

I had the same error and the problem was that I built the app in Release mode but the main.jsbundle was dev mode.
Using react-native#0.61.5
I stopped the Metro process and run again
react-native run-ios --configuration Release --device --scheme="MyTargetScheme"

For us the issue was that we were (manually) building the RN bundle for our production app without setting the dev value in the react-native CLI.
When testing on simulator or device with a debug configuration in Xcode, this was not a problem. But since we archive for the App Store with a release config, we were seeing this crash in production.
The react-native bundle command has the --dev switch set to true by default. So the solution was simply to add --dev false to the bundle command.

In my case, my issue is resolved by node -v changes.
Initially I have used node 9.4.0 and then I have changed the node to 12.
Due to this version change the above error occurs.
So I have changed to node 9.4.0 and rebuild the app in release mode. It works fine
Any one know why the node version changes failed to bundle the app in release mode

In my specific situation, I was using a deprecated version of expo/ex-navigation , in RN 0.64.2 we had one problem, because RN doesn't understood the #2x.android or similars casts to choose the right image for an Icon. The problem is Described here : #31348.
I sold my conflicts locally inside node_modules and make Android work fine (then I forked and create a correction under my control), but when I came back to work in my IoS problems, I forgot to use this correction.
So, my problem was occurring in one lib i had in my node_modules, and as I extensively searched, this problems use to happen in this kind of situation.
So if #takameyer solution doesn't work as it doesn't to me, I suggest taker a look in your node_modules dependencies...
probably trying to build your bundle thought react-native-cli will give you an better log then building this in xcode, since in my case xcode build worked but give-me a run-time error(Release).
I hope it help someone in the future.

This crash reason is when your Target is Release Mode and your bundle is Development Mode.
So my iOS target was set to Release
And my bundle was build to Development, with this command :
react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --platform='ios' --assets-dest='./ios'
So to fix this, i build again my bundle with this command.
react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'
And works.
Thanks #sumizome and #strdr4605 i made this with your answers.

Related

React has been deprecated - React Native

I am creating an app using React Native and am trying to install cocoa pods for iOS but when I enter pod install into the terminal I get the following warning.
Then when I try to run my app in an iOS emulator it crashes and won't run.
Here is the Xcode error.
I am running react native 0.63.2.
Here is my pod file
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
require_relative '../node_modules/react-native/scripts/react_native_pods'
target 'Example' do
# Comment the next line if you don't want to use dynamic frameworks
#use_frameworks!
# Pods for Example
# pod 'React', :path => '../node_modules/react-native'
pod 'RNSound', :path => '../node_modules/react-native-sound'
pod 'RNCAsyncStorage', :path => '../node_modules/#react-native-community/async-storage'
pod 'RNCMaskedView', :path => '../node_modules/#react-native-community/masked-view'
pod 'RNCPushNotificationIOS', :path => '../node_modules/#react-native-community/push-notification-ios'
pod 'react-native-slider', :path => '../node_modules/#react-native-community/slider'
pod 'RNFBApp', :path => '../node_modules/#react-native-firebase/app'
pod 'RNFBAuth', :path => '../node_modules/#react-native-firebase/auth'
pod 'RNFBMessaging', :path => '../node_modules/#react-native-firebase/messaging'
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'
pod 'react-native-safe-area-context', :path => '../node_modules/react-native-safe-area-context'
pod 'RNScreens', :path => '../node_modules/react-native-screens'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
target 'Example-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
target 'ExampleTests' do
inherit! :search_paths
# Pods for testing
end
end
target 'Example-tvOS' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Example-tvOS
end
The issue is that you don't install pod for the correctly target.
This is strange if this is a new RN project because it should take the correct target.
In you recently image added seems like you have another target called AntrimElimChurch so if you want to install pod for that target you should change it in PodFile as well
am running react native 0.63.2.
Here is my pod file
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
require_relative '../node_modules/react-native/scripts/react_native_pods'
target 'AntrimElimChurch' do
# Comment the next line if you don't want to use dynamic frameworks
#use_frameworks!
# Pods for Example
# pod 'React', :path => '../node_modules/react-native'
pod 'RNSound', :path => '../node_modules/react-native-sound'
pod 'RNCAsyncStorage', :path => '../node_modules/#react-native-community/async-storage'
pod 'RNCMaskedView', :path => '../node_modules/#react-native-community/masked-view'
pod 'RNCPushNotificationIOS', :path => '../node_modules/#react-native-community/push-notification-ios'
pod 'react-native-slider', :path => '../node_modules/#react-native-community/slider'
pod 'RNFBApp', :path => '../node_modules/#react-native-firebase/app'
pod 'RNFBAuth', :path => '../node_modules/#react-native-firebase/auth'
pod 'RNFBMessaging', :path => '../node_modules/#react-native-firebase/messaging'
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'
pod 'react-native-safe-area-context', :path => '../node_modules/react-native-safe-area-context'
pod 'RNScreens', :path => '../node_modules/react-native-screens'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
target 'Example-tvOSTests' do
inherit! :search_paths
# Pods for testing
pod 'react-native-notifications', :path => '../node_modules/react-native-notifications'
end
target 'ExampleTests' do
inherit! :search_paths
# Pods for testing
end
end
target 'Example-tvOS' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Example-tvOS
end
After this change run again pod install and it should build

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

First its not duplicated. Because i have different issue. I upgraded my react Native version to '0.62.2' (I wish I hadn't upgraded). I'm dealing with a lot of problems right now.This is my problem now No podspec found for React-Core in ../node_modules/React and I couldn't solve it
It is seen that there is always wrong path in similar problems. But even though I wrote the correct path, it gives an error. Also when I look at '../node_modules/react-native' I can't see the React-Core file here
[![enter image description here][1]][1]
I found similar problems and solutions. as in the examples below
No podspec found for `React-Core` in `../node_modules/react-native/React`
No podspec found for `React-Core` in `../node_modules/react-native`
pod install
Analyzing dependencies
Fetching podspec for DoubleConversion from ../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec
[!] No podspec found for React-Core in ../node_modules/React
Podfile
platform :ios, '9.0'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
target 'DGFonder' do
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/React'
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
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'
p
end
swift4 = ['Charts']
post_install do |installer|
installer.pods_project.targets.each do |target|
targets_to_ignore = %w(React yoga)
if targets_to_ignore.include? target.name
target.remove_from_project
end
target.build_configurations.each do |config|
if swift4.include?(target.name)
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
end
end
```
[1]: https://i.stack.imgur.com/NNLjD.png
React is now part of react-native in node_modules. So, you need to update your React-Core pod as:
pod 'React-Core', :path => '../node_modules/react-native/React'
Notice react-native in path specified.
I got the same issue this is because of node_modules
just do following steps
remove all node_modules
run npm i and check if there is any Vulnerabilities then perform npm audit fix
go to ios folder
run pod install
and it will work
i also face the same issue,
solution:-
you have updated git clone package
npm install
3.open path nodemodules/rn-fetch-blob
open rn-fetch-blob.podspec file
change React/native to React-native
cd ios && pod install
7.for android open android studio and then open your project android folder in android studio
8.for ios first go to ios folder of your project and then open RECA.xcworkspace
9.Run build in Xcode
Thanks

React Native Pod Error - [!] Invalid `Podfile` file: 767: unexpected token at ''. | Related Issue #448

I have already tried : #448
Environment
System:
OS: macOS 10.15
CPU: (4) x64 Intel(R) Core(TM) i5-4250U CPU # 1.30GHz
Memory: 30.63 MB / 4.00 GB
Shell: 3.2.57 - /bin/sh
Binaries:
Node: 10.15.3 - /usr/local/bin/node
Yarn: 1.19.2 - /usr/local/bin/yarn
npm: 6.13.1 - /usr/local/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
IDEs:
Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
Description
➜ ios git:(master) ✗ pod install --verbose
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19/rbconfig.rb:229: warning: Insecure world writable dir /Users/jack/Desktop/root in PATH, mode 040777
[!] Invalid Podfile file: 767: unexpected token at ''.
from /Users/jack/Desktop/root/outonox/quibik/ios/Podfile:45
use_native_modules!
end
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/podfile.rb:301:in rescue in block in from_ruby' /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/podfile.rb:295:in block in from_ruby'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/podfile.rb:50:in instance_eval' /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/podfile.rb:50:in initialize'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/podfile.rb:293:in new' /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/podfile.rb:293:in from_ruby'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/podfile.rb:259:in from_file' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/config.rb:200:in podfile'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:150:in verify_podfile_exists!' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command/install.rb:46:in run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in run' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:52:in run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/bin/pod:55:in <top (required)>' /usr/local/bin/pod:23:in load'
/usr/local/bin/pod:23:in `
'
Reproducible Demo
Not sure why this is happing, but this is started after installing "#react-native-firebase" this package
POD FILE
platform :ios, '9.0' require_relative
'../node_modules/#react-native-community/cli-platform-ios/native_modules'
target 'quibik' do # Pods for quibik
pod 'RNFBAuth', :path =>
"../node_modules/#react-native-firebase/auth" pod 'RNFBApp', :path
=> "../node_modules/#react-native-firebase/app"
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'
pod 'react-native-splash-screen', :path =>
'../node_modules/react-native-splash-screen'
target 'quibikTests' do
inherit! :search_paths
# Pods for testing end
use_native_modules! end
target 'quibik-tvOS' do # Pods for quibik-tvOS
target 'quibik-tvOSTests' do
inherit! :search_paths
# Pods for testing end
end
Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
rm -rf package-lock.json
cd ios
pod install
What worked for me is:
Install Yarn Package manager
npm install --global yarn
In order to not to mix package managers
rm package-lock.json
Then run;
yarn install
cd ios && pod install && cd ..
npx react-native run-ios
Good luck!

React/RCTDefines.h' file not found (RN0.61)

Performed RN upgrade from RN0.60 to RN0.61. Build failed with iOS, due to the following issue:
/react-native/React/Base/RCTBridgeModule.h:10:9: 'React/RCTDefines.h' file not found
I am aware of this breaking changes. (React.xcodeproj is deprecated)
Try a few things
npx react-native-clean-project & re-setup project
remove Pods/ & pod install
...running out of idea...
Here's how my podfile looks like.
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'
# Required by RNFirebase
pod 'Firebase/Core', '~> 6.9.0'
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
pod 'Fabric', '~> 1.10.2'
pod 'Crashlytics', '~> 3.14.0'
# FBSDK
pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
pod 'react-native-netinfo', :path => '../node_modules/#react-native-community/netinfo'
pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'
pod 'react-native-webview', :path => '../node_modules/react-native-webview'
Here's my solution after spending a full day in digging the reason why,
.
.
.
.
TLDR;
You need to add .podspec to podfile for whichever 3rd party/custom library that complain unable to find React/{whatever.h}
3rd party Libraries
If you are using a 3rd party library (Yarn/NPM/etc)
Copy podspec from other 3rd party library (eg, RNDeviceInfo/etc..)
Create own podspec by replacing a few item (s.name, s.source) I actually left others as default but you can modify as per your usage if you want
s.name = "NoSupportedLib"
s.source = { :git => "https://github.com/react-native-community/NoSupportedLibName.git", :tag => "v#{s.version}" }
You might want to take care the following, because not all your dependency may store under the folder path ios/**/your.m & your.h files
s.source_files = "ios/**/*.{h,m}"
Add new line to podfile
pod 'NoSupportedLib', :path => '../node_modules/NoSupportedLib'
Pod install
Local Dependencies
In the case where you have a local dependency, you should do the same as well (instead of adding the .a file into your Xcode's Linked Framework and Libraries.)
Follow the same steps as described on top
At step 2 where you declare the s.source & s.source_files, you shall do the following: (Assumption you are create this custom.podspec at the same custom library path, you would otherwise need to modify the s.source path as your need)
s.source = { :http => 'file:' + __dir__ + '/' }
s.source_files = "customLib/*.{h,m}"
Add new line to podfile
pod 'customLib', :path => '../localDependency/customLib'
Sub-points
I tried adding React under my scheme as build target, apparently it does not help. I think for project that is >=RN0.60, we are meant to use autolinking provided by ReactNative? Hence to keep our Xcode's Linked Framework and Libraries clean.
I've had the same issue a while ago. It was fixed after: product > scheme > edit scheme, go to the build tab and add react as the first target.
I had this same issue, I went into /node_modules/react-native/React/Base/RCTBridgeModule.h and changed #import <React/RCTDefines.h> into
#if __has_include("RCTDefines.h")
#import "RCTDefines.h"
#else
#import <React/RCTDefines.h>
#endif
ref below link
https://github.com/facebook/react-native/issues/26754#issuecomment-539550146
Go to Project navigator > Libraries > RNFetchBlob.xcodeproj
Click on Build Settings and then the first item under "Targets"
Scroll down to 'Search Paths' -> 'Header Search Paths'
Make sure to have enable filter 'All'
Add the following entry (click '+'): ${SRCROOT}/../../../ios/Pods/Headers
Make sure to set it to recursive.
Clean (cmd + shift + K) and re-build (cmd + B)
Solved here

'React/RCTEventEmitter.h' file not found (CocoaPods)

I'm going back to a React Native project and getting the following build error:
'React/RCTEventEmitter.h' file not found
The project uses CocoaPods to bring in React and its dependencies. The error seems to be to do with a missing header in one of my custom modules. The specific line with the import error is at https://github.com/adamski/react-native-couchbase/blob/8bc089a1e4cfdf62599b1f156072aa12a3823b30/ios/RCTCouchBase/RCTCouchBase/RCTCouchBase.h#L8
The error only started to appear after adding a new node module and running pod install.
I've have tried various things to fix it such as:
Upgrading RN (from 0.51 to 0.55 and back again)
Deleting and reinstalling node_modules
Adding various paths to Header Search Paths. e.g. ${PODS_ROOT}/Headers/Public/React
Deleting Build folder
If I change the import to #import "RCTEventEmitter" it then falls over on:
'React/RCTBridge.h' file not found from RCTEventEmitter.h.
Anything else that could be going wrong here?
I recently had to upgrade to Xcode 10 for another project, perhaps that is an issue?
Podfile:
react_native_path = '../../node_modules/react-native'
install! 'cocoapods', :deterministic_uuids => false
platform :ios, '8.0'
target 'MyApp - App' do
pod 'HockeySDK', '~> 4.1.3'
pod 'React', :path => '../../node_modules/react-native', :subspecs => [
'ART',
'Core',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTText',
'RCTWebSocket',
'RCTAnimation',
'DevSupport',
'BatchedBridge',
# Add any other subspecs you want to use in your project
]
# To use CocoaPods with React Native, you need to add this specific Yoga spec as well
pod 'yoga', :path => react_native_path + '/ReactCommon/yoga'
pod 'couchbase-lite-ios', '~> 1.4.0'
pod 'couchbase-lite-ios/ForestDB', '~> 1.4.0'
pod 'mp3lame-for-ios'
pod 'ReactNativeCouchbase', :path => '../../node_modules/react-native-couchbase'
pod 'ReactNativeNavigation', :path => '../../node_modules/react-native-navigation'
pod 'RNVectorIcons', :path => '../../node_modules/react-native-vector-icons'
pod 'RNSVG', :path => '../../node_modules/react-native-svg'
pod 'RNDeviceInfo', :path => '../../node_modules/react-native-device-info'
pod 'react-native-in-app-utils', :path => '../../node_modules/react-native-in-app-utils'
pod 'react-native-mail', :path => '../../node_modules/react-native-mail'
pod 'BVLinearGradient', :path => '../../node_modules/react-native-linear-gradient'
pod 'RNSound', :path => '../../node_modules/react-native-sound'
pod 'react-native-youtube', :path => '../../node_modules/react-native-youtube'
pod 'RNStoreReview', :path => '../../node_modules/react-native-store-review/ios'
end