I have created a new project called auth using react-native init auth at terminal.When i tried to run the project using react-native run-ios. The build failed and gave a error 'React/RCTBridgeDelegate.h' file not found.
Tried to update the react native version
react-native run-ios at terminal in mac
I expect the build to be successful and see the ios simulator The actual result which i got is build failed and hence cant see the simulator
Do the following ot fix this: Open the terminal and go to your project ios directory. Type in pod init (If it doesn't exist) and then pod install. Open the workspace project and delete the build from ios folder.
To clean the iOS build press Option+Shift+Command+K or go to Xcode menu Product -> Clean Build Folder.
React Native 'React/RCTDefines.h' file not found This error appears when RN core libraries aren't referenced correctly, which can be caused by different kinds of integrating or linking issues. It often happens when you have your dependencies linked using relative path in a podfile, rather than statically in a project.
However with this newer version of react that project is not present, which would explain why building will fail if you have a native module bridge (its searching for header files that don't exist) I no longer get the build error, but I haven't verified it works. Will update once I get a positive outcome (or a negative one for that matter).
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` I've encountered this issue while upgrading from 0.58.4 to new react-native version 0.60.4.
react-native link. If you see error message similar to the following CocoaPods error message during react-native link, delete the auto-generated Podfile.lock in your ios folder and run react-native link again. [!]
The issue is related to cocoapods dependency manager. Do the following ot fix this:
pod init
(If it doesn't exist) and then pod install
react-native run-ios
from terminal.It should work now.
In my case the libPods-FOO.a
library had somehow become unlinked when I did a pod update && pod install
. To see if this applies to you:
In Xcode, check under Project Navigator:
[Your Project Name] --> Targets --> [Your target name] --> General
Scroll down to Frameworks, Libraries and Embedded Content
If you don't have a libPods-XXXX.a
in there (where XXXX is your project name) then add it:
libPods
in the search boxlibPods-XXXX.a
and click Add
.Just a hint: for those of you using the M1 Macs, pod install
won't work. You should use arch -x86_64 pod install
as stated in this issue
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With