React-native: <React/RCTLog.h> <React/RCTBridge.h> are not found since I upgrade react-native to 0.40

Created on 23 Jan 2017  Β·  50Comments  Β·  Source: facebook/react-native

Hello guys,

are not found since I upgrade react-native to 0.40
Sometimes also is not found.

I tried
_"react-native-git-upgrade"
_"rm -rf node_modules/"
_"watchman watch-del-all"
_"rm -fr $TMPDIR/react-*"
_"npm i"

But the build still Fail :-(

Locked

Most helpful comment

Try the following:

  1. Clean (cmd+shift+K)
  2. Build core React - select React as the scheme in Xcode and build it (cmd+B)
  3. Build the library that is failing (e.g. RCTText).
  4. Build your app.

All 50 comments

In addition to those above I will sometimes get React/RCTViewManager.h not found in RCTRawTextManager.h on line 10 #import <React/RCTViewManager.h>.
This is confusing since I changed all of my RCT includes to have the <React/ prefix, but these errors seem to be occurring in the React library.

Could this possibly be 3rd party library related? The errors never occur in a dependency library. Or possibly react-native-git-upgrade is not fully changing everything. I've tried to get this working with a manual upgrade and still have troubles

Did all the steps above plus react-native link still nothing. Also deleted DerivedData cache.

react-native: 0.40.0
react: 15.4.2
react-native-cli: 2.0.1
npm: 3.10.7

EDIT
The only 3rd party iOS dependencies I have are:
react-native-blur(1.3),
react-native-linear-gradient(2.0),
react-native-vector-icons(4.0)

which all have been updated for 0.40 RN. I'm not able to get a new repo to upgrade to v0.40 with react-native-git-upgrade

same issue here

In addition on RCTLocationObserver.m:10
10:9: fatal error: 'React/RCTEventEmitter.h' file not found

import

    ^

1 error generated.
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

Hope you can help us :-)
Regards,

same problem here, this issue gives some advice but nothing worked for me https://github.com/facebook/react-native/issues/11721

Hello guys,

I solved it by disabling parallelization but I don't know if it's a good thing.
The packager is slow enough, and I think it's slow down xcode too.
I really dont think this should be turned off. But you can try by doing this:
(From badasve Source: https://github.com/facebook/react-native/issues/11721)

  • In Xcode, go to the project scheme (Product -> Scheme -> Manage Scheme -> double click your project).

  • Click on the 'Build' option at the left pane.

  • Uncheck 'Parallelize Build' under Build Options.

  • Then in Targets section, click '+' button then search for 'React'. Select it and click 'Add'.
    'React' should now appear under Targets section. Click and drag it to the top so that it will be the first item in the list (before your project).

  • Clean the project and build.

EDIT:
I tried to selected back the parallelize Build

but this error is back! Don't know what to do..:

import

    ^

1 error generated.
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

I've followed the above advice ^ and still not getting anything. I believe that fix aims to disable parallelization so the React package can compile first. However it is not solving the problem for me. @oblador If this is a bug do we have a ticket I can refer to?

So I've removed my Xcode, deleted derivedData, reset my computer, installed a new Xcode project, react-native init'd a new project and built it and I still get this error. Pretty lost at this point 😞

Try the following:

  1. Clean (cmd+shift+K)
  2. Build core React - select React as the scheme in Xcode and build it (cmd+B)
  3. Build the library that is failing (e.g. RCTText).
  4. Build your app.

I was upgrading from 0.33, so I settled on using to 0.39 for now, I guess I'll wait until this headers change is not so new anymore

Thanks LoopIndigo!

Now I can compile on Xcode, but when I compile from the Terminal with
"react-native run-ios"
The Build still Fail

* BUILD FAILED *

The following build commands failed:
CompileC PATH/ios/build/Build/Intermediates/RNGL.build/Debug-iphonesimulator/RNGL.build/Objects-normal/x86_64/RCTConvert+CaptureConfig.o RCTConvert+CaptureConfig.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

@clovs glad to hear it works. I don't use run-ios and just stick to Xcode (my reason was more around the capability of run-ios to handle projects in sub-directories) so I can't be much help there.

Are you fine with sticking to XCode or is run-ios a blocker for you?

Yeah I'm fine for now with Xcode
Thanks again :-)

@clovs thanks you man!

Π½Π΅ Π·Π° Ρ‡Ρ‚ΠΎ )))

@clovs сколько ΠΆΠ΅ Ρ‚Ρ‹ Π²Ρ€Π΅ΠΌΠ΅Π½ΠΈ ΠΏΠΎΡ‚Ρ€Π°Ρ‚ΠΈΠ» Π½Π° магичСский фикс с порядком компиляции?))))

With the help of @LoopIndigo @badasve in two days the issue was solved.

;)

@LoopIndigo's solution worked for solving the majority of my issues - Thanks!

My React scheme builds without any issues, but I'm seeing an error regarding RCTEventEmitter within React.

screen shot 2017-01-25 at 12 01 34 pm

Any ideas?

Have the same problems with 41-rc. This issue should be open!

https://github.com/facebook/react-native/issues/12077

@rpylipow Make sure you don't have any #import "RCTEventEmitter.h" directives either in your own project or in any third-party native modules you might be using (inside React itself is ok). Change them to #import <React/RCTEventEmitter.h>.

That error appears when a header is being imported in both different ways somewhere across the build.

@LoopIndigo what do you mean by 3rd no point:
Build the library that is failing (e.g. RCTText). (?)

My was failing in AppDelegate.m file :

import "AppDelegate.h"

import "RCTBundleURLProvider.h" (file not found)

import "RCTRootView.h" (file not found)

For my part, I just recreated a new project with 0.40.
copy and past all src/, reinstall all third party libraries.
After that all errors was out.

I suggested you to do the same, to resolve this issue faster.

ok I will follow your suggestion but it really taking time again setting up all libraries again and including fonts etc :( ... but is there any solution with 0.39.0 version. ????? Now I have 0.39 version.

For me, after days of struggling, several things were required to get 0.40/0.41 working:

  1. As described in this comment, make sure Dead code stripping is set to No for all build targets

  2. Make sure that in your release-schema in the run-job, the Build Configuration is set to Debug (not release or whatever)

  3. Remove these headers from HEADER_SEARCH_PATHS in all your build-configurations:

    • "$(SRCROOT)/../node_modules/react-native/React/**",
    • "$(SRCROOT)/../node_modules/react-native/ReactCommon/**",

@freakinruben we have build schemes that are Debug-*. Would that be an issue from what you have figured out. Thanks.

@nim23 No it shouldn't be, I only have one debug schema but multiple release schemes, and that seems to work well

Got a solution. My is working please follow these comments https://github.com/evollu/react-native-fcm/issues/201. See my comments over there.

Upgrading to 0.40+ has been a really frustrating experience.
I tried 0.35>0.41, including ~6 native modules all which claim 0.40+ compatibility.
In the end while I got the Xcode project to compile, when actually running on Simulator/Android the Packager would no longer import static images that had worked previously, e.g.
<Image source={require('path/to/image.png')}>

  • RedBox'd out. Tried clearing watchman cache, reinstalling node_modules, etc. the things @freakinruben suggested (cheers) -- no luck.

I don't have the time to waste on this - disappointed & sticking with 0.39 for now.

I have tried everything as well and nothing makes these issues go away permanently. :-/
This is the worst update of react-native with much support for upgradation.

I got solution.
I solved this issue with this provided solution:

1- opened workspace file before opening close everything.

2- added pod file in manage scheme suggested by :https://stackoverflow.com/questions/40358719/framework-not-found-googletoolboxformac

3- also i followed this suggestions too: http://stackoverflow.com/questions/9458739/ld-warning-directory-not-found-for-option

4-I also updated pod update.

5- Clean and build it's working now.

@rohitgoyal Did you try this solution? It fixed issues for me with archiving a release with a different build-name than 'release'

I've finally fixed this issue with this solution πŸ‘
To solve the issue, you have to do the following:

  • In Xcode, go to the project scheme (Product -> Scheme -> Manage Scheme -> double click your project).
  • Click on the 'Build' option at the left pane.
  • Uncheck 'Parallelize Build' under Build Options.
  • Then in Targets section, click '+' button then search for 'React'. Select it and click 'Add'.
  • 'React' should now appear under Targets section. Click and drag it to the top so that it will be the first item in the list (before your project).
  • Clean the project and build.

@RajanPN You saved my day :)

Just wanted to follow up to how I resolved the Packager issue I noticed while doing the RN upgrade.
My project folder had a '+' in the path, and after a lot of frustration on a hunch I tried moving to a path with only 'normal' Roman characters.
Before:
/Users/me/projects/+client/app/
After:
/Users/me/projects/client/app/

This actually fixed the Packager issues mentioned above.
Just sharing in case it helps someone else.

@clovs wtf - not sure why that worked, I literally added a library, and then removed it but still had issue, before I added that library, everything was fine. I had to do this work around you added after adding library.

WTF is wrong with React-Native?

I tried all the solutions, but nothings work, i am using RN0.44, apps works fine on simulator as well as on phone with release config. But fails to archive.

@arun542 I was with same problem only when archiving and I solved adding React as target dependency on build phases settings of your project

@RajanPN thanks bro

@geekvijay @herarya Good to know that it worked!

@agrass i tried that also did not work. In the end i had to recreate the project from scratch and i worked automatically. Something was screwed up in that project.

Same issue - app builds fine under Simulator but archiving is throwing all kinds of .h not being found from RN package...

Guys - this is the complete fix. I am able to archive the project just fine. The target section this fix refers to is under the scheme, Build screen.

Fix is here

On top of this I had to add header search paths in my project
$(SRCROOT)/../node_modules/react-native/React

What a mess!!!

Seems to be the same fix as RajanPN highlighted earlier :)

I have a feeling a lot of people are getting into this situation by creating a new scheme when wanting to do a prod build. Instead of selecting new scheme from xcode make sure you duplicate your current scheme. Schemes are created with parallelization on by default, also you'd be missing vital things such as including the React build target.

Instead of creating a new scheme for production do the following:

Goto edit scheme > manage schemes > click the cog after selecting your local scheme and click duplicate scheme, you can then edit that and select build for release.

Tried everything that is mentioned above but still does not work. I am using 0.52.
Its my second day with react-native and I am just gonna keep on hustling till I fix it.
Why are there so many problems with react-native?

https://github.com/facebook/react-native/issues/17027

The above issue is actually my issue. Somebody has submitted a pull request

My issue was that I was building on a custom Schema, in my case, "Staging". I had to change the Per-Configuration Build Products Path and the Per-configuration Intermediate Build Files Path to use the "Release" paths instead of the "Staging" path.

If you're project contains Pods, you will need to adjust these values in the Pod project as well as change the PODS_CONFIGURATION_BUILD_DIR config for that custom schema so that it matches the Release schema

Hello Guys,

I just updated to RN52 from RN38, solved all of my RCT includes to have the

I have a 'RCTBridge+Private.h' file not found when trying to build.

I tried updating to ^2.2.6, unlink and re-link but still not working.

Has anyone been facing he same issue ?

Thanks

@russelh15 Thank you so much! I do not know if this is the ideal solution, however having just spent a half day getting things working I am fine with this.

I tried deleting node-modules and installing packages back and it worked. Hope this will help someone else :)

React-native ...

I do <3 you but sometimes you make me feel crazy...

I have the same problem.... :( 'React/RCTBridge.h' file not found with expo kit 26 and react-native-beacons-manager

Was this page helpful?
0 / 5 - 0 ratings