In Xcode I have created a new Staging
build configuration. I duplicated the Release
configuration to make it. Both the Release
and the Debug
configurations build just fine. When I select the Staging
config I end up with header issues. I have checked in the build settings to ensure that all three configs have the same header search paths.
As an important side note, the issues are popping up between a couple libraries I have that are referencing each other.
To be specific I am using a library called CodePush that references the React library like this:
#if __has_include("RCTEventEmitter.h")
#import "RCTEventEmitter.h"
#else
#import "React/RCTEventEmitter.h"
#endif
Which the RCTEventEmitter.h
file in tern states #import <React/RCTBridge.h>
and it is with the RCTBridge file that the header file not found is coming from.
I am using react native 0.40 and react-native-code-push 1.16.1-beta.
Any thoughts as to what could be causing the issue. Please let me know if you need any more info and I will gladly provide. I would like to mention that I do not believe this to be an issue with the libraries but rather my set up. I suspect this is just the first library that the compiler hits.
The issue is with the way RN 0.40 handles headers. React only knows about Release and Debug, so you have to add the Release headers path to your staging configuration and make sure React is built first as a dependency.
Scheme:
Product->Scheme->Manage Schemes
. Target Dependencies:
Header Path:
REACT_HEADERS_PATH
and set the value to $(BUILD_DIR)/Release-$(PLATFORM_NAME)/include
. It should resolve to something like build/Release-iphoneos/include
$(REACT_HEADERS_PATH)
to the list for the Staging configuration only.Now Clean and Build...
I found this solution here on Github after struggling for 2 days. All credit goes to the author of that comment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With