Skip to content

fix React-jsitooling build error for use_frameworks build #50252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

Kudo
Copy link
Contributor

@Kudo Kudo commented Mar 25, 2025

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

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

--- 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[])
 {

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. p: Expo Partner: Expo Partner labels Mar 25, 2025
@Kudo Kudo force-pushed the @kudo/fix-jsitooling-module branch from 0c5d2d6 to 38cfd10 Compare March 26, 2025 17:59
@Kudo Kudo marked this pull request as ready for review March 27, 2025 09:35
@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Mar 27, 2025
@facebook-github-bot
Copy link
Contributor

@cipolleschi merged this pull request in 7786805.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @Kudo in 7786805

When will my fix make it into a release? | How to file a pick request?

fabriziocucci pushed a commit that referenced this pull request Mar 28, 2025
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.

[IOS] [FIXED] - `JSRuntimeFactoryCAPI.h` build error for  `use_frameworks` build

Pull Request resolved: #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
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @Kudo in 6c907ee

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. Merged This PR has been merged. p: Expo Partner: Expo Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants