4
votes

I am unable to build iOS App because of the issue - 'React/RCTBridgeModule.h' file not found

"react": "^16.13.1", 
"react-native": "^0.63.4", 
"react-native-document-picker": "^4.2.0"

iOS target -- 10.0

I already tried a few of the suggested solutions including this. Though, unable to follow the following step, as there was no React.xcodeproj file available

Add react as a project dependecy

Xcode Project Navigator -> drag React.xcodeproj from Libraries to root tree Build Phases Tab -> Target Dependencies -> + -> add React

Also tried https://stackoverflow.com/a/52425997/1479511 and https://stackoverflow.com/a/41664041/1479511

but still no luck yet :(

enter image description here

UPDATE

Tried following the steps suggested by @Muhammad Numan in the answer.

  1. Check that I have React in my pods (pod 'React', :path => '../node_modules/react-native/'). If not, add it.
  2. Uninstall reinstall pods (pod deintegrate && pod clean && pod install in the ios folder, I believe the pod deintegrate command needs to be downloaded and isn't available by default)

Error

So, modified contents of React.podspec from

s.dependency "React-Core", version
  s.dependency "React-Core/DevSupport", version
  s.dependency "React-Core/RCTWebSocket", version
  s.dependency "React-RCTActionSheet", version
  s.dependency "React-RCTAnimation", version
  s.dependency "React-RCTBlob", version
  s.dependency "React-RCTImage", version
  s.dependency "React-RCTLinking", version
  s.dependency "React-RCTNetwork", version
  s.dependency "React-RCTSettings", version
  s.dependency "React-RCTText", version
  s.dependency "React-RCTVibration", version

to

s.dependency "React/Core", version
  s.dependency "React/Core/DevSupport", version
  s.dependency "React/Core/RCTWebSocket", version
  s.dependency "React/RCTActionSheet", version
  s.dependency "React/RCTAnimation", version
  s.dependency "React/RCTBlob", version
  s.dependency "React/RCTImage", version
  s.dependency "React/RCTLinking", version
  s.dependency "React/RCTNetwork", version
  s.dependency "React/RCTSettings", version
  s.dependency "React/RCTText", version
  s.dependency "React/RCTVibration", version

followed by the command pod repo update

Then, afterwards, getting this error

Current Error

2
Pls try removing pods folder and podfile.lock and try run pod update.HGK
Getting same error with pod update too @HGKNarendra Singh

2 Answers

0
votes

enter image description here

I think you have the react missing thing, here's what I did.

  1. Check that I have React in my pods (pod 'React', :path => '../node_modules/react-native/'). If not, add it.
  2. Uninstall reinstall pods (pod deintegrate && pod clean && pod install in the ios folder, I believe the pod deintegrate command needs to be downloaded and isn't available by default)
  3. Go to scheme -> edit scheme -> build, delete the React(missing) using the 'minus' button. Click on 'add' or a 'plus' button. Find React (should be in the Pods category) and add it. Finally, make sure all boxes are ticked for React, and place it at the top of the list.

Here you go, I hope this helps. If however you do not have the React(missing), I have no idea how to solve this since i've never had this problem :/

0
votes

I have previously fixed this issue with this solution, which actually caused by React Native breaking changes (React.xcodeproj is deprecated).

Since the details answer is in the linked post, I do not re-post the entire solution here again but just a TLDR for you.


TLDR;

You need to add .podspec to podfile for whichever 3rd party/custom library that complain unable to find React/{whatever.h}