mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: to resolve use_frameworks build error. this is an edge case happening only when there's objective-c files import to `React_RCTAppDelegate`. Xcode will have `include of non-modular header inside framework module` error originally. this is the generated umbrella header for jsitooling is incorrect. even the header path are correct, they are not modular headers. ~this pr adds a workaround to import header from outside the module.~ updates: this pr uses a forward declaration to prevent exposing the dependency in umbrella header. ## Changelog: [IOS] [FIXED] - `JSRuntimeFactoryCAPI.h` build error for `use_frameworks` build Pull Request resolved: https://github.com/facebook/react-native/pull/50252 Test Plan: to reproduce the build error, we can build `USE_FRAMEWORKS=static bundle exec pod install` from rn-tester. we also need to import `React_RCTAppDelegate` from objective-c files. in this case, we can add `import React_RCTAppDelegate;` in rn-tester's main.m ```diff --- a/packages/rn-tester/RNTester/main.m +++ b/packages/rn-tester/RNTester/main.m @@ -8,6 +8,9 @@ #import <UIKit/UIKit.h> #import "AppDelegate.h" +@import React_RCTAppDelegate; +// This also triggers the error +//#import <React_RCTAppDelegate/React-RCTAppDelegate-umbrella.h> int main(int argc, char *argv[]) { ``` Reviewed By: fabriziocucci Differential Revision: D71963188 Pulled By: cipolleschi fbshipit-source-id: 5d566ae5aadb9efc032aacfe32862ea289134f87