Creating new assembly configuration results in header No error found

In Xcode, I created a new Staging assembly configuration. I duplicated the Release configuration to do this. Release and Debug configurations are built just fine. When I select the Staging configuration, I get problems with the header. I checked in the build settings so that all three configurations had the same header search paths.

As an important note, problems arise between the two libraries that I have that reference each other.

To be specific, I use the CodePush library, which references the React library as follows:

 #if __has_include("RCTEventEmitter.h") #import "RCTEventEmitter.h" #else #import "React/RCTEventEmitter.h" #endif 

Which RCTEventEmitter.h file is in the tern states of #import <React/RCTBridge.h> , and it is with the RCTBridge file that the header file was not found.

I am using native 0.40 reaction and reactive-native code-push-1.16.1-beta.

Any thoughts on what might cause the problem. Please let me know if you need more information and I will be happy to provide you with information. I would like to mention that I do not think that this is a problem with libraries, but my setup. I suspect this is only the first library the compiler gets into.

+5
source share
1 answer

The problem is how RN 0.40 handles headers. React only knows about Release and Debug, so you need to add the Release headers path to your intermediate configuration and make sure that React is first created as a dependency.

Scheme:

  • Go to Product->Scheme->Manage Schemes .
  • Double click on your circuit. In my case, I made a staging schema and set the assembly configuration to Substitution in the Run section.
  • Then, in the Build section, make sure that Parallel Collection is turned off.
  • Verify that the React build target is on the target list. If not, click the + button, add it and drag it up. Then click Close .

Target Dependencies:

  • Now select your goal in the navigator, go to Build Phases and in the Target Dependencies section add React. This ensures that Xcode assemblies will respond to the rest of the project.

Header Outline:

  • Select your target in the navigator, go to Build Settings .
  • Press + , add the custom setting REACT_HEADERS_PATH and set the value to $(BUILD_DIR)/Release-$(PLATFORM_NAME)/include . It should solve something like build/Release-iphoneos/include
  • Then, as before, in Build Options, scroll up to the Header Search Path and add $(REACT_HEADERS_PATH) to the list just for setting up the stage.

Now clean and create ...

I found this solution here on Github after the battle for 2 days. All reviews belong to the author of this comment.

+14
source

Source: https://habr.com/ru/post/1262894/


All Articles