I've been trying to archive my using Xcode 10 beta 4, and after getting past this issue I got a different issue when archiving the project:
/Users/rodrigovasconcelos/MyApp/mobile/ios/MyApp-Bridging-Header.h:5:9: error: 'React/RCTBridgeModule.h' file not found
#import <React/RCTBridgeModule.h>
^
1 error generated.
<unknown>:0: error: failed to emit precompiled header '/Users/rodrigovasconcelos/Library/Developer/Xcode/DerivedData/MyApp-cpkesijquffkhgfgaagxybgvqlpr/Build/Intermediates.noindex/ArchiveIntermediates/Edge/PrecompiledHeaders/MyApp-Bridging-Header-swift_1E09NP8RKFO6-clang_1NNXX086AFKFR.pch' for bridging header '/Users/rodrigovasconcelos/MyApp/mobile/ios/MyApp-Bridging-Header.h'
The issue does not occurs if I try to build and archive using the latest stable version of XCode (9.4.1)
So far, I've tried to re-install my Pods, clean XCode derived data and node_modules folder, and also looked for similar issues, but nothing helped it.
The issue was actually related to how React and Xcode handle custom project configurations (different then Release / Debug).
I stumbled upon the solution reading this issue, but I'll paste it here in case the link somehow expires:
Added the React build target under the current scheme for my project. (Sidenote: if you're using fastlane to deploy, keep your project's build target in first place, otherwise fastlane gets confused and thinks you're building a library, so it never builds an ipa).
Added React under [Target] > Build Phases > Target Dependencies, which made Xcode build React before building the rest of the project.
Under [Target] > Build Settings, added a new User-Defined setting, called REACT_HEADERS_PATH. For all configurations not named
Debug or Release, I set that to
$(BUILD_DIR)/Release-$(PLATFORM_NAME)/include.
Under [Target] > Build Settings > Header Search Paths I added $(REACT_HEADERS_PATH) as an entry.
Repeat for all targets in your project.
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