'RCTLog.h' file not found & Use of undeclared identifier 'RNBRANCH_VERSION' build-time error while creating an archive for iOS app.

Dear Apple Developers,

I write to you this message to discuss with you a major issue I have been struggling with for the past two weeks related to creating an archive for our project's iOS application.

Before I go in-depth with the issue, I want to mention that our team lead is enrolled in the Apple Developer Program for which we have a valid distribution signing certificate and distribution provisioning profiles associated with our application. To expedite the process, I have provided you with our Bundle ID and Team ID in our personal technical support query to you so that you may look up any necessary information about our project, should you need to. In addition to that, I thought I may make a post on this forum in case anybody in the public knew the solution to it already.

I also want to state that I have already followed the steps in this Prepare for app distribution page to prepare our app for distribution and all the requirements have been met to create an archive for our app. I have also looked around the Developer Documentation and "Apple Developer Forums" for a solution to this and tried precisely eleven different solutions to fix this depending on posts from other users of the forum as well as from Github issues and Stackoverflow links, but none seemed to resolve this. I found the Developer Documentation to be slightly outdated as it is not updated often and as for the Apple Developer Forums, I simply could not find a solution to this.

The technical issue is as follows: it seems to be appearing in the RNBranchConfig.m file within the react-native-branch package for iOS specifically in lines 9 and 23 that 'React/RCTLog.h' file not found and Use of undeclared identifier 'RNBRANCH_VERSION' respectively. Now you may be wondering that this issue may be related to the package provider but for the former error, it seems as though the package cannot detect the React target dependencies and in particular, this RCTLog.h file which is located within Facebook's React framework. Thus, it seems to me that this may be an issue within Xcode itself not being able to detect the connected dependencies. I wish I could attach images onto here so that you could see the error message precisely as it was appearing to me in Xcode.


To reproduce the issue, do the following:

1) Open the <project>.xcodeproj in Xcode and add the RNBranch.xcodeproj manually into the Library directory. I did this to remove the -lBranch not found error I was experiencing in Xcode earlier.

2) Go to Product > Clean Build Folder to start the build process afresh.

3) Make sure that the device to run the target app on is Generic iOS Device in the top-left corner next to the Run symbol.

4) Click on Product > Archive to start the archiving process of generating the .ipa file which compresses the app into a file that can be distributed to other software (I am using this so that I can distribute the app to BETA testers via Firebase App Distribution). 

5) For me, during the archive process, it pops up a terminal window showing that dependency graphs have been loaded, as it should.

6) After a minute or so, it shows that there are two compile-time errors, both in the same aforementioned file. Specifically it is: 'React/RCTLog.h' file not found (line 9) and Use of undeclared identifier 'RNBRANCH_VERSION' (line 23).

In terms of the solutions I have tried so far, there is a comprehensive list I created in the following Github issue link, with detailed screenshots and images, highlighting the solutions I have given a try. It is very comprehensive and contains specific details with code captures. I hope you can review it before you respond to me: https://github.com/BranchMetrics/react-native-branch-deep-linking-attribution/issues/609.

Now that you have read the ELEVEN possible solutions I have tried, you can see that I have tried so many different things to get RNBranchConfig.m to detect RCTLog.h in the React dependency, but NONE worked! I am currently out of options and that is why I ask for some help. We need to get our app released for BETA testing within two weeks now so I also have a time constraint, which, as a developer, is quite stressful as you can imagine.

Below, find details about the version of the various tools, software, packages and libraries I am using while I encounter this error so that you may assist me faster:

react-native: ^0.60.0, ^0.61.2, ^0.62.1 and ^0.63.3
react: ^16.13.1 and ^16.90
react-native-branch: ^5.0.0
cocoapods: cocoapods-1.8.4
node: v12.14.1
npm: 6.13.4
Xcode: 11.4
macOS: Catalina 10.15.5
ruby: ruby-2.6.3
react-native-cli: 2.0.1

I also have an Xcode archive log and a build log generated by the IDE. The archive log is too long to attach here and the build log I shall attach on here as a text attachment:

.
Any help is greatly appreciated.


Thank you,
Farhan Kassam.
If the Github link in the post above does not work, you can try clicking on this one: https://github.com/BranchMetrics/react-native-branch-deep-linking-attribution/issues/609.

'RCTLog.h' file not found &amp; Use of undeclared identifier 'RNBRANCH_VERSION' build-time error while creating an archive for iOS app.
 
 
Q