Building my React Native app in Xcode 11.3.1 gives me the error:
"React/RCTBridgeDelegate.h" file not found in AppDelegate.h
only when building an additional target (Release Scheme) directly in Xcode. When building the standard development target, I have no problems.
More detailed:I have a React Native app with a Watch companion app. The app is equipped with different additional React Native modules. The app runs smoothly when building it in the standard build target (Development scheme) via React Native cli (react-native run-ios
) as well as when building the standard build target (Development scheme) directly in Xcode.Already a while ago, I have created a duplicate set of targets in Xcode (Release scheme). Building the duplicate target for the iOS app in Xcode bundles the React Native code and images as an additional build phase to be able to deploy the app on an iPhone not depending on the development server. Building this target worked out smoothly as well for a long time.
Now all of a sudden since some days when I want to build my duplicate target (Release scheme) in Xcode I am getting the error
I can still build the standard build target (Development scheme) via console react-native run-ios
and also directly in Xcode with no problems. I not sure what caused this issue now, the only change to my config I have made some days ago is that I have added some additional modules to my React Native app, e.g. react-native-keychain and react-native-push-notification. Both have been configured correctly as I would assume, also pods have been installed as necessary and I can see that those modules also work well when building the development target, so I don't think that adding those additional modules caused the issue.
I have read all issues on StackOverflow describing this problem and have already tried all of the following solution proposals with no effect unfortunately:
- Make sure that "Parallelize builds" is deactivated in scheme (had already done that by the time when duplicating the development target creating a release target). Also make sure that target "React" is listed above the app build target in "Build" option of the scheme.
- Deintegrate pods and re-install pods
- List additional target in the Podfile with "inherit! :search_paths", again deintegrate and re-install pods --> gives me a warning that the additional target in the Podfile "overrides the
HEADER_SEARCH_PATHS
build setting" - Clean the build and repeat step 2
- Add the React path directly in the HEADER_SEARCH_PATHS in target build settings --> gives me linker errors
- Explicitly build target "React" first - Clean Build, Build target "React", then build my release target
I am stuck and would really appreciate your help - do you have further ideas on what I can try out to solve this annoying problem?