-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
New React Native project won't build on Xcode 13. #31733
Comments
👋 Adrian, couple of quick questions:
Some folks have reported that their project have been building fine with Xcode 13 |
Via CLI and manually - android/app/build.gradle - ios/Podfile And update - package.json https://react-native-community.github.io/upgrade-helper/?from=0.64.2&to=0.65.0-rc.2 Builds on XCode 12.5 Build fails on XCode 13.0 beta: Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider facebook/react-native#31733
Same error logs here with XCode 13.0 beta and 0.65-rc.2 referenced above ^ XCode 12.5 builds fine on both 0.64.2 and 0.65.0-rc.2 I'm on macOS Monterey 12.0 Beta too |
Seems related to flipper, disabling it builds successfully for now as a temporary workaround Podfile - use_flipper!()
+ # use_flipper!() pod install ios/MyApp/AppDelegate.m + // #ifdef FB_SONARKIT_ENABLED
+ // #import <FlipperKit/FlipperClient.h>
+ // #import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
+ // #import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
+ // #import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
+ // #import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
+ // #import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
+ // static void InitializeFlipper(UIApplication *application) {
+ // FlipperClient *client = [FlipperClient sharedClient];
+ // SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
+ // [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
+ // [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
+ // [client addPlugin:[FlipperKitReactPlugin new]];
+ // [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
+ // [client start];
+ // }
+ // #endif
...
+ // #ifdef FB_SONARKIT_ENABLED
+ // InitializeFlipper(application);
+ // #endif I've raised the issue here: facebook/flipper#2477 |
Can flopper be opt in and not too invasive in project code? Too much problems for nothing. |
@leotm You might want to checkout this comment: zalando/SwiftMonkey#80 (comment) |
@alexisbronchart confirmed that eb93886 fixes build issue in Xcode 13. I'm closing this. |
This PR did not fixed my pipeline
|
I just created a new Swift file + Bridging Header with literally nothing inside these files and the build completed successfully. Have no clue why this worked, but it did lol |
Same, swift file and bridge header works. |
Same here, just created a new Swift file + Bridging Header and it worked!!. I don't know why Lol |
I have updated to |
Bridging Header didn't help in rn 0.63. I had to turn off flipper |
I'm also using 0.63, Try this for flipper:
|
Someone building a project with
SolutionCreate a bridging header, as described above.
|
I completely agree, everytime I make a project I have to go through this hassle with Flipper. |
If you upgrade RN version and get to change the iOS target version to 11, don't forget to change it from Xcode under Build Settings => iOS Deployment Target. |
Doing the following fixed the issue for me in Xcode without disabling Flipper:
I'm using RN 0.64.2 |
@nriccar, what packages are you using and how many broke during the upgrade? |
Only one, react-native-view-pager. Why? |
I'm using native react 0.64.0 and it worked for me after commenting out the use_flipper!() line In Podfile. |
Finally fixed this after so many headaches... Using React Native 0.66 and in Podfile, if in the post_install section you have a line of code calling an "Xcode 12.5 M1 workaround" then you have to comment it out if you're using Xcode 13 or higher (I'm using 13.2 Beta). Just to note, I'm using macOS Monterey, which doesn't allow Xcode 12.5.1 or other earlier versions. Also, I am using an M1 MacBook Air. |
I have follow leotm here and gcrozariol here and samridhgupta here and Saveen here but I'm still having the error while build. I already publish the app last month and turn off mac. And when I open to do some change to code, the error shows up.
Why is it suddenly happening? |
Hi Evan, I don't see the 'Create bridging header' option after creating a swift file. I just get a blank swift file in the root dir it looks like. |
Looks like this will be fixed in 0.67 https://github.com/facebook/react-native/pull/32284/files but for anyone looking for a workaround see my comment on the Flipper thread: facebook/flipper#3150 (comment) |
@mercpls Xcode can be buggy, create a bridging header manually or use Expo's new custom managed workflow to fix. |
If you recently upgraded nodejs with nvm and got this error. Try this: |
Description
Running a new React Native project on Xcode 13 beta throws the following error:
React Native version:
Steps To Reproduce
npx react-native init testproject
.npx react-native run-ios
.Expected Results
I expected the application to build.
The text was updated successfully, but these errors were encountered: