score:167
in my case this particular problem happened when i was trying to archive a 0.40+ react-native app for ios (solution was found here: reliable build on ^0.39.2
fails when upgrading to ^0.40.0
).
what happened was that xcode was trying to build the react-native libraries in parallel and was building libraries with implicit react dependencies before actually building the react library.
the solution in my case was to:
disable the parallel builds:
- xcode menu -> product -> scheme -> manage shemes...
- double click on your application
- build tab -> uncheck parallelize build
add react as a project dependecy
- xcode project navigator -> drag react.xcodeproj from libraries to root tree
- build phases tab -> target dependencies -> + -> add react
score:-3
what you can do to get it right is:
1) npm uninstall reat-native-fs
to uninstall library
2)npm unlink react-native-fs
to unlink the library
now the library is successfully removed and now install the lib again in your project and this time link everything manually. sometime automatic linking causes this error.
score:0
if you want to make it from your editor also open smobile.xcscheme
and change parallelizebuildables = "no"
score:0
for me didn't work any from the above solutions and below it is what worked (i had already checked out parallelize build
and added react
)
1. open xcode --> to libraries add `$librarywhichdoesnotwork.xcodeproj$`
2. then for your app in the `build phases` add to the `link binary with libraries` the file `lib$librarywhichdoesnotwork$.a`
score:0
i've encountered this issue while upgrading from 0.58.4 to new react-native version 0.60.4. nothing from what i found on the internet helped me, but i managed to get it working:
go to build settings, search for 'header search paths', select the entry, press delete button.
i had these values overriden, and looks like they fell back to defaults after deletion. also cocoapods was complaining about it with messages in terminal after pod install
:
[!] the `app [release]` target overrides the `header_search_paths` build setting defined in `pods/target support files/pods-app/pods-app.release.xcconfig'. this can lead to problems with the cocoapods installation
score:0
if you want to keep parallelise build enabled and avoid the missing header problems, then provide a pre-build step in your scheme to put the react headers into the derived-data area. notice the build settings are coming from the react project in this case. yes it's not a thing of beauty but it gets the job done and also shaves a lot of time off the builds. the prebuild step output ends up in prebuild.log. the exact headers you'll need to copy over will depend on your project react-native dependencies, but you'll get the jist from this.
get the derived data directory from the environment variables and copy the required react headers over.
#build_prestep.sh (chmod a+x)
derived_root=$(echo $shared_derived_file_dir|sed 's/derivedsources//1')
react_base_headers=$(echo $project_file_path|sed 's#react.xcodeproj#base/#1')
react_view_headers=$(echo $project_file_path|sed 's#react.xcodeproj#views/#1')
react_modules_head=$(echo $project_file_path|sed 's#react.xcodeproj#modules/#1')
react_netw_headers=$(echo $project_file_path|sed 's#react/react.xcodeproj#libraries/network/#1')
react_image_header=$(echo $project_file_path|sed 's#react/react.xcodeproj#libraries/image/#1')
echo derived root = ${derived_root}
echo react headers = ${react_base_headers}
mkdir -p ${derived_root}include/react/
find "${react_base_headers}" -type f -iname "*.h" -exec cp {} "${derived_root}include/react/" \;
find "${react_view_headers}" -type f -iname "*.h" -exec cp {} "${derived_root}include/react/" \;
find "${react_modules_head}" -type f -iname "*.h" -exec cp {} "${derived_root}include/react/" \;
find "${react_netw_headers}" -type f -iname "*.h" -exec cp {} "${derived_root}include/react/" \;
find "${react_image_header}" -type f -iname "*.h" -exec cp {} "${derived_root}include/react/" \;
the script does get invoked during a build-clean - which is not ideal. in my case there is one env variable which changes letting me exit the script early during a clean.
if [ "$run_clang_static_analyzer" != "no" ] ; then
exit 0
fi
score:1
this error appeared for me after i ran pod install
command for the new dependencies. along with those, react had also been installed. therefore probably xcode was confused for path. i removed these lines from podfile and error was gone. please note that those removed from here were already linked in xcode.
target 'app' do
pod 'googlemaps'
pod 'firebase/auth', '~> 6.3.0'
pod 'firebase/database', '~> 6.3.0'
# removed four pods below and it worked.
pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
pod 'reactnativepermissions', :path => '../node_modules/react-native-permissions'
pod 'react-native-image-resizer', :path => '../node_modules/react-native-image-resizer'
pod 'rnfs', :path => '../node_modules/react-native-fs'
end
score:1
go to ios folder in your project and install pod -
$ pod install
if you are getting any error in installation of pod type command-
$ xcode-select -p
result should be - /applications/xcode.app/contents/developer
if the path is incorrect then open your ios project in xcode and go to: xcode->preferences->command line tools-> select xcode
and again install the pod your issue will be fixed.
score:1
i receive this error in any new module i create with create-react-native-module. none of the posted solutions worked for me.
what worked for me was first making sure to run yarn
in the newly created module folder in order to create node_modules/
(this step is probably obvious). then, in xcode, select product -> scheme -> react instead of the default selection of mymodulename.
score:1
anhdevit's suggestion in https://github.com/facebook/react-native/issues/24363#issuecomment-488547280 worked for me:
in your terminal, run:
defaults delete com.apple.dt.xcode
score:2
latest releases of react-native libraries as explained in previous posts and here have breaking compatibility changes. if you do not plan to upgrade to react-native 0.40+ yet you can force install previous version of the library, for example with react-native-fs:
npm install --save -e react-native-fs@1.5.1
score:2
i was able to build a debug, but i was unable to build an archive.
i solved this issue by dragging react.xcodeproj
found in /node_modules/react-native/react to my root directory in xcode, then added react as a target dependancy in build phases > target dependencies.
score:2
after react native 0.60 this issue is often caused by a linked library mixed with the new 'auto-linking' feature. this fixes it for me
unlink old library using
$ react-native unlink react-native-fs
refresh pods integration entirely using
$ pod deintegrate && pod install
now reload your workspace and do a clean build.
score:2
i ran into this issue after doing a manual react-native link
of a dependency which didn't support auto link on rn 0.59+
the solution was to select the xcodeproj file under the libraries folder in xcode and then in build settings, change header search paths to add these two (recursive):
$(srcroot)/../../../ios/pods/headers/public/react-core
$(srcroot)/../../../ios/pods/headers/public
score:2
my solution was to remove everything in libraries
like described here
score:3
for viewers who got this error after upgrading react native to 0.40+, you may need to run react-native upgrade
on the command line.
score:3
if libraries/react.xcodeproj
are red in xcode then reinstall node_modules
rm -rf node_modules && yarn
my newly created project from react-native 0.46.3 was red :s i have npm 5.3.0 and yarn 0.24.5 when i did react-native init
score:4
for me, this error occurred when i added a new scheme/target (app.staging) in the app and installed pods using pod install.
this issue is occurring due to pods are not shared for all targets. so i need to add newly added target (app.staging) inside the podfile.
here is my podfile.
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 'fbreactnativespec', :path => "../node_modules/react-native/libraries/fbreactnativespec"
target 'apptests' do
inherit! :search_paths
# pods for testing
end
# pods for staging app // important line below
target 'app.staging'
use_native_modules!
end
score:15
change
#import "rctbridgemodule.h"
to
#import "react/rctbridgemodule.h"
score:28
quick fix (not the best)
change the import react-native header lines:
#import <react/rctbridgemodule.h>
#import <react/rctlog.h>
to:
#import "rctbridgemodule.h"
#import "rctlog.h"
here is an example of changes i had to make for the library i was trying to use: closes #46 - 'rctbridgemodule.h' file not found.
Source: stackoverflow.com
Related Query
- React Native build failed: 'React/RCTBridge.h' file not found
- React native-env file could not be found within the project
- File not found error when trying to 'fetch' json in React App
- React, Node, Mongodb : My image file is not being served from backend and trying to render it on the React side throws 404 not found
- PHP backend file not found error with react front end
- Typescript react - Could not find a declaration file for module ''react-materialize'. 'path/to/module-name.js' implicitly has an any type
- `React/RCTBridgeModule.h` file not found
- React Native: JAVA_HOME is not set and no 'java' command could be found in your PATH
- React Native / Xcode Upgrade and now RCTConvert.h not found
- React Router BrowserRouter leads to "404 Not Found - nginx " error when going to subpage directly without through a home-page click
- Webpack + React + TypeScript: Module not found ... in ... node_modules/react/
- React JS Server side issue - window not found
- React unable to import component -- module not found
- <React/RCTDefines.h> file not found
- Compatible side by side NDK version was not found React Native
- React Native: error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found
- React input type file onChange not firing
- Surge-deployed React app - getting 404 Page Not Found
- React-Native: React could not be found within project or in these directories
- React Webpack not rebuilding when edited file outside docker container (on mac)
- Installing React Native Map. AIRMap not found in UIManager
- Module not found when import .jsx file
- symbol not found Android React Native
- Invariant Violation: requireNativeComponent: "FastImageView" was not found in the UIManager in react native
- Firebase-Admin, importing it to react application throws Module not found error
- SetupProxy file not being read in Create React App Typescript
- AppDelegate.h:8:9: fatal error: 'React/RCTBridgeDelegate.h' file not found #import <React/RCTBridgeDelegate.h>
- React Native packager.sh: line 11: node: command not found
- What is Prettier keyboard shortcut command in VS Code to format only a block of React code, not just format on file autosave?
- React Starter Kit error - page not found
More Query from same tag
- React Dropdown Custom Component
- Cant get the value of an ajax call in an action in mobx, instead I get Proxy
- Problem with filling input and communication problem with redux in React
- React - prop-types is marked as required
- Is it possible to pass the Parent instance to a Child compontent into props attributes?
- Including libraries from node_modules in Wordpress Plugin
- React styled-components low performance when state changes on mousemove
- Formik and arrayField integration with material ui
- Firebase: how refresh idToken on http request if currentUser is null
- Jest - Test gives an error TypeError: Cannot read property 'then' of undefined
- "Functions are not valid as a React child" when trying to use HOC from a module object
- ReactJS save submission from input for other API calls
- Pass a handler from class to component in loop
- How to migrate default export to named export?
- react-native-community/CheckBox can't resolve module
- Typescript firebase photoUrl
- Adding expressjs to a custom reactjs application
- First value of array undefined
- How to use setState call back to update value prop of TextInput
- React-Router (experimental v6) render problem?
- Corrupt video uploads when chunking MediaRecorder to Google Cloud platform
- FlatList don't show me any result why?
- React Router - one of two routes
- Re-render React descendant components without re-rendering ancestors
- How to set a value to a variable inside ternary
- Import() in React - fires error in the Chrome/Firefox extensions
- Should data go in a redux state tree?
- How to wrap all the react examples in styleguidist with a custom theme provider?
- Customize existing component with fixed css classes in React
- How to use one array as keys for another array?