Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS - RN 0.61.1 migration] React/RCTBridgeModule.h file not found #26678

Closed
alnorris opened this issue Oct 1, 2019 · 36 comments
Closed

[iOS - RN 0.61.1 migration] React/RCTBridgeModule.h file not found #26678

alnorris opened this issue Oct 1, 2019 · 36 comments
Labels
Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Type: Upgrade Issue Issues reported from upgrade issue form

Comments

@alnorris
Copy link

alnorris commented Oct 1, 2019

Reopening bug that is wrongly closed
#26615

React Native version: 0.61

Steps To Reproduce

  1. Upgrade to 0.61 with upgrade-helper-tool
  2. If your project has a 3rd party module that are Linked manually, building it results in: React/RCTBridgeModule.h file not found

Describe what you expected to happen:
To compile correctly

@alnorris alnorris added the Bug label Oct 1, 2019
@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Oct 1, 2019
@react-native-bot
Copy link
Collaborator

Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?

👉 Click here if you want to take another look at the Bug Report issue template.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Resolution: Needs More Information labels Oct 1, 2019
@Cosmin-Ciolacu
Copy link

Reopening bug that is wrongly closed
#26615

React Native version: 0.61

Steps To Reproduce

  1. Upgrade to 0.61 with upgrade-helper-tool
  2. If your project has a 3rd party module that are Linked manually, building it results in: React/RCTBridgeModule.h file not found

I have same issue

@loga4
Copy link

loga4 commented Oct 2, 2019

the same

many libraries migrated to pods

[!] CocoaPods could not find compatible versions for pod "ReactCommon/callinvoker":

@ma96o
Copy link
Contributor

ma96o commented Oct 2, 2019

@loga4
Have you checked #26599?

@loga4
Copy link

loga4 commented Oct 3, 2019

@ma96o thks!

@craftmusic
Copy link

craftmusic commented Oct 6, 2019

Also being affected by this and can no longer link + build my custom native module that worked before i upgraded to 0.61.2

@Alaa-Ben
Copy link

Alaa-Ben commented Oct 9, 2019

Hi @alnorris !
When you go to scheme -> edit scheme -> build. Do you have see React (missing) ? If so, i might have a solution because this happened to me. If not, need more information :/

@usrbowe
Copy link
Contributor

usrbowe commented Oct 10, 2019

I had the same issue. I just did following to fix:

  1. Remove the package-name.xcodeproj of package from Libraries in Xcode
  2. Remove package Frameworks if any, in Xcode.
  3. Remove package from Build Phases > Link Binary with Libraries
  4. Remove search headers of that package in: Build Settings > Header Search Paths (do that for all project Targets, even -tv, -tests)
  5. Make sure the package implements correctly package-name.podspec file in root (check any community based package for reference)
  6. run cd ios && pod install
  7. Run: Clean ⇧+⌘+K & Clean Build Folder ⎇+⇧+⌘+K

This helped me solve the missing xxx.h files from React.
I also did remove React.xcodeproj from scheme build targets, since it was remove in latest release.

@alnorris
Copy link
Author

alnorris commented Oct 10, 2019

@usrbowe This is good workaround, but it doesn't solve the issue of manually linked packages. Some old packages don't have podspecs and have package owners that are unresponsive to PR's to add them.

@grabbou
Copy link
Contributor

grabbou commented Oct 11, 2019

Can you point me to an example of such a library? I will try to reproduce it. You can also zip me your project and I will try to see what changes are needed to make it work.

My understanding is that these cases are deprecated and we are moving towards fully automatic linking w/o relying on that.

@alnorris
Copy link
Author

alnorris commented Oct 12, 2019

@grabbou, any library without a podspec. Ex: https://github.com/smalltownheroes/react-native-adobe-analytics. If manual linking is in fact deprecated, I would advise we need to include this as a breaking change in the change log, and remove this from the documentation: https://facebook.github.io/react-native/docs/linking-libraries-ios#manual-linking

@alpamys-qanybet
Copy link

@grabbou, I have similar situation, I cannot use React-native-navigation V2 or V3 because of bugs, but V1 does not support ^RN60above, can you help, I have my forked RNNV1?

@zinete
Copy link

zinete commented Oct 16, 2019

Hi @alnorris !
When you go to scheme -> edit scheme -> build. Do you have see React (missing) ? If so, i might have a solution because this happened to me. If not, need more information :/

My question is this, is there any way to solve it?

@Alaa-Ben
Copy link

@zhenghui0705 well if 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 :/

@TommyLeong
Copy link

@zhenghui0705 Here's how I made it work with the workaround.
React/RCTDefines.h' file not found (RN0.61)

@GutteApps
Copy link

After burning a day on this, building with legacy build system did the trick:
File>Workspace Settings> Build system > legacy build system

@vivianlamCP
Copy link

any solution? I also find this error in upgrading to RN 0.61.5

@luco
Copy link

luco commented Dec 10, 2019

Getting this on 0.61.4

@luco
Copy link

luco commented Dec 12, 2019

I managed to fix it by adding $(SRCROOT)/../../../../ios/Pods/Headers/Public/** in Header Search Paths (recursive) to each 3rd party target. React it's only accessible by pods now.

@lgh06
Copy link

lgh06 commented Dec 30, 2019

I managed to fix it by adding $(SRCROOT)/../../../../ios/Pods/Headers/Public/** in Header Search Paths (recursive) to each 3rd party target. React it's only accessible by pods now.

faced same issue.

pod deintegrate && pod cache clean --all && pod install
added Header Search Path
used legacy build.

Skipped this error.


try also react-native unlink ${LIB_NAME} then pod install in ios directory.
may also caused by already manually linked conflicts with auto linking.

@luatnd
Copy link

luatnd commented Jan 2, 2020

@zhenghui0705 well if 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 :/

It seems OK, but in my case: After click Plus Sign > I cannot found React in Pods, only ReactCore and ReactCoreModules were seen :(
So I tried to add ReactCore + ReactCoreModule, but failed :D
Looking forward to finding a new workaround.

I would try to unlink all manual dependencies (my project was created in 0.59 > Upgraded to 0.60.5 > Upgrading to 0.61.5 and stucking here)

@d3020
Copy link

d3020 commented Jan 3, 2020

Is there any updated solution for this? I'm using react native 0.61.5 and still getting the React/RCTBridgeModule.h file not found in ImagePickerManager.h?

@luatnd
Copy link

luatnd commented Jan 6, 2020

I spent 2 days on getting this all in one workaround:
#26665 (comment)

@1rjun
Copy link

1rjun commented Feb 19, 2020

Just install everything from Pods,
cd ios
pod init
install all the required libraries using pod,
remove all the .xcodeproject from libraries,
remove all the libraries from linked frameworks and libraries except libPods-ProjectName.a
Go to your Build Setting, Header Search Paths, remove all the paths and add “$(SRCROOT)/Pods/Headers/”

Now open .xworkspace and your code will work like a charm

https://medium.com/@arjunsinghrajput/something-wrong-with-react-native-b398d5a66278

@raphaelpinel
Copy link

2. pod deintegrate && pod clean && pod install
@Alaa-Ben
pod clean is not a valid command. Did you mean
pod cache clean?

@Alaa-Ben
Copy link

Alaa-Ben commented Mar 6, 2020

@raphaelpinel
pod cleanand pod deintegrate are downloadable plugins:
sudo gem install cocoapods-deintegrate cocoapods-clean

@hamoudaarfaoui
Copy link

Hi @alnorris !
When you go to scheme -> edit scheme -> build. Do you have see React (missing) ? If so, i might have a solution because this happened to me. If not, need more information :/

Yes it does for me , can you help ?

@willnaoosmith
Copy link

Same error here

@hamoudaarfaoui
Copy link

the only solution that worked for me is that you create .podspec file to whatever library you using and install it using Pods , and dont manual link or anything of that .. saddly not all libraries are up to date, so had to do it yourself manually to setup a .podspec file

@EhteshamAnwar
Copy link

@loga4
Have you checked #26599?
@ma96o did this and the run pod install, I got this error.
image

@hamoudaarfaoui
Copy link

@willnaoosmith
Copy link

The solution, for me, was deleting the entire ios folder, generating a new project with react-native-init, and moving the ios folder from the newer project to the official one.
wrong?
yes
but it worked.
maybe this happens when you upgrade your react native version

@hramos hramos added the Type: Upgrade Issue Issues reported from upgrade issue form label Apr 16, 2020
@github-actions
Copy link

Do you need help upgrading to a newer React Native version? Visit the Upgrade Support repository or use the upgrade helper to see the changes that need to be made to upgrade your app.

@simon-davies-avtura
Copy link

@raphaelpinel
pod cleanand pod deintegrate are downloadable plugins:
sudo gem install cocoapods-deintegrate cocoapods-clean

Absolutely got myself in a tangled mess with the state of projects/podfiles/caches. I backed out my (very messy) changes then tried the above deintegrate and clean, pow, really unexpected but it was a silver bullet! Reloaded everything and it just worked. Thank you so much for the suggestion.

@Hamza6244
Copy link

Still, I'm getting the same error anyone finds a solution for this? Basically, I'm using react-native-create module lib for but it creates iOS folder without pod file so now i want to use pods and when i'm adding custom pods then i'm getting React/RCTBridgeModule.h file not found

@abdelhedydev
Copy link

This solution was solved my problem
joltup/rn-fetch-blob#461 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Type: Upgrade Issue Issues reported from upgrade issue form
Projects
None yet
Development

No branches or pull requests