Can't find ”RCTAssert.h” while compiling after freshly generated project on v0.10.0
It seems there's an error in v0.10.0 that causes application generated with react-native init to not be compilable immediately. The fix is to open <AppName>.xcodeproj/project.pbxproj and find and replace any mention of "$(SRCROOT)/node_modules/react-native/React/**" with "$(SRCROOT)/../node_modules/react-native/React/**" (note the ..)
Seem like you don't have node_modules installed under project directory. Run npm install inside you project folder.
"$(SRCROOT)/node_modules/react-native/React/**" seem fine to me if you have node_modules installed correctly under your project dir.
I am facing the same issue, and npm install doesn't do anything for me since 'react-native' was already installed.
Looking through the file, it seems that there are some path inconsistencies in the <AppName>.xcodeproj/project.pbxproj file as mentioned by the poster.
And changing the paths as suggested fixes the issue..
I think this is the file and it has the correct paths - https://github.com/facebook/react-native/blob/f0dd9fb358efb94fba4dd2ba74fb4910bd929056/local-cli/generator-ios/templates/xcodeproj/project.pbxproj.
Yeah, I was just looking at that, I am going to try generate a new react-native app and see if it has the correct paths.. Is there a generator step that changes that anywhere?
Nope, same issue.. looking to see if that template is being manipulated somewhere downstream in terms of the SRCROOT path..
I just generated a new project and seems like this is only a problem with tests. If i remove the testing code then the build works fine.
cc @ide
Can someone submit a PR to fix this? I'm about to take off on a flight right now and can take a look and publics 0.10.1 when I land in a few hours.
I had the same problem. After trying a bit I just copied all the React/Base/ files into my iOS/appTests/. That solved the problem for me!
Let me know if that helps!
The problem for me was that the Test Target had an incorrect Header Search Path. This can be fixed by going into xcode, selected the Test Target, going to build Settings, going into the section "Search Paths".
Inside this "Search Paths" section, there is a "Header Search Paths" attribute, select it and make sure there is a search path: $(SRCROOT)/../node_modules/react-native/React set to Recursive. MAKE SURE THE ".." is present after $(SRCROOT) or it will be looking in the wrong directory. MAKE SURE YOU'RE LOOKING IN THE TEST TARGET, NAMED {YOURAPP}Tests

@brenmcnamara's fix worked for me
This seems to have been introduced in 0.10 (e9f69bc2e4bff3aaff2f77268087c362916d3756), but fixed in 0.11rc with the move to yeoman (f83675d1915b5e77638c117c82f8641cea367ffe). Seems like we might want to fix this on the 0.10-stable branch and release 0.10.1, yes?
Yes, that sounds good. @philikon are you able to test whether the yeoman commit fixes things?
@ide yes, I just confirmed that it's fixed in master/0.11. But OMFGWTFSIGH we changed the format of the project again, this time from iOS/ to ios/ cc @a2 @foghina @mkonicek
hey guys, how do i update to 0.11? i just got the same issue with correct search path set.. removing test code kind of solves this issue. but don't think that should be the solution. so, how do i fix it?
Can confirm this happens on a completely fresh install—I installed react native for the first time ever, followed the instructions on Getting Started precisely and ran into this. And like @inselmensch the correct path (as proposed as a solution above) has already been set.
I can also confirm it works on 0.11, and @philikon's fix looks good.
For anyone else stuck on this, @brenmcnamara's walkthrough for the Header Search Paths is the way to go.
react-native 0.10.1 is now on npm with @philikon's diff. Let us know if things are working for you.
@yorkie you may have a stale npm cache or be reading from a mirror. The npm repo has 0.10.1:
$ npm v react-native time | grep '0\.10\.1'
'0.10.1': '2015-08-28T19:59:24.605Z' }
@brenmcnamara Thank you, your solution help me to fix this. I do not know why in year 2018, this problem still occur :( so sad