React-native: [iOS][v0.40] Unable to archive - React/RCTDefines.h file not found

Created on 7 Feb 2017  路  21Comments  路  Source: facebook/react-native

Description

I am currently having issues archiving the application. The issue only occurs when attempting to archive, running in debug mode works just fine. Possibly related to #12042.

When attempting to archive the app the following occurs:

screenshot 2017-02-07 17 26 00

Was wondering whether anyone has come across this, and if there are any solutions. I've attempted various things, including solutions mentioned in #12042 however my knowledge of iOS development is minimal.

Additional Information

  • React Native version: 0.40
  • Platform: iOS only
  • Operating System: MacOS
Locked

Most helpful comment

@ggordan Following most of these steps just solved my problem with this error: http://imgur.com/a/KUOQC - in particular step 2.

Thanks to @skellock for posting.

All 21 comments

@ggordan Following most of these steps just solved my problem with this error: http://imgur.com/a/KUOQC - in particular step 2.

Thanks to @skellock for posting.

Thanks for the suggestion @zibs . Unfortunately, none of those steps seem to have worked. The file not found error changes from time to time. Right now it's something different, though the app builds and runs just fine.

screenshot 2017-02-08 10 00 41

Is DEAD_CODE_STRIPPING disabled for all your targets?

Do you have any 3rd party libs installed that haven't been upgraded?

@freakinruben DEAD_CODE_STRIPPING is disabled for Debug and Release.

@skellock All third party libraries have been upgraded, and the issue appears to be coming from within react-native libraries. Maybe it could be an issue with 3rd party libraries, but I imagine that in that scenario I wouldn't be able to build and run the app, which isn't the case.

The fact that it happens not all the time is even more strange.. But debugging this is a pain in the butt, I ended up throwing away the xcode project, workspace and schemes and recreating them, without much luck the first few tries.
Did you try deleting node_modules and downloading them again, making sure the ^ of the specified versions doesn't mess with the versions you want from npm?

@ggordan I've seen Xcode fail with that error before (blaming wrong lib) when I've had a 3rd party lib not upgraded AND when i've missed the new import statements up at my app level (both in the app & default test).

@ggordan Just found this solution which fixed issues for me with archiving a release with a different build-name than 'release'

@freakinruben thx for closing the loop! Something about Xcode was definitely off. I remember being able to compile in Xcode, but not the command line at one point. If I had hair left, I'd tear it out.

@freakinruben Thanks a lot for that. Managed to get it to archive

FWIW, I have $300 on the table for anyone that can figure out how to upgrade DiscourseMobile per:

https://discuss.reactjs.org/t/having-a-hell-of-a-time-upgrading-from-react-native-39-to-40/6331

@SamSaffron I'd like to help if no one else do that, I'm always using the bleeding edge version of React Native

@nihgwu sounds like a plan, should I update that topic to say that you are taking this? any timeframe?

Ok, I'll done in an hour or two, I suppose

@nihgwu awesome, will update the topic, if you need to fork any of the dependencies and submit fixes as well feel free to point your PR at the forks.

Hi, is it possible to reopen this issue ? I can build in release mode with no problem but when i try to archive i always get this error:
/node_modules/react-native/Libraries/Vibration/RCTVibration.h:10:9: 'React/RCTBridgeModule.h' file not found

screen shot 2017-03-09 at 10 38 29

By the way i created a new project already in this version of react-native.

React-Native Version : 0.41.2
react Version: 15.4.2
Xcode Version : 8.2
Mac OS El Capitan

[Update] I resolve this issue Adding React to Build Target before the app and uncheking parallelize build.

I have done all the settings, unchecked parallelize, Added React to build target before the app, still no luck. Fails while archiving with error 'React/RCTBundleURLProvider.h' file not found in appDelegate.m . Works on simulator, iphone 6 device with release config but archiving fails

@zibs Very useful to me, thank you very much

I got this error when using cocoapods 1.5 to install dependencies, but it went away when I downgraded to 1.4.

For reference:
$ sudo gem uninstall cocoapods
$ sudo gem install cocoapods -v 1.4.0
Then re-run $ pod install in your ios folder.

@stephan-nordnes-eriksen Very useful to me. Thank you so much.

Was this page helpful?
0 / 5 - 0 ratings