facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.26k stars 24.35k forks source link

Xcode 12.5 troubleshooting guide (RN 0.61/0.62/0.63/0.64) #31480

Closed kelset closed 3 years ago

kelset commented 3 years ago

Hey folks.

This issue wants to be a follow up to https://github.com/facebook/react-native/issues/31179; that issue has become really long so opening a new one to try and reduce the noise and confusion around it.

Here is how to fix the Xcode 12.5 iOS build breaks with errors related to "atomic_wait_until is unavailable" (and similar messages).

(sidenote: make sure you are using cocoapods 1.10.x)

If you are on 0.61

Note well: this has only been tested by a few members of the community, not by me, so I can't ensure it will work.

If you are still using RN 0.61, you can refer to this comment https://github.com/facebook/react-native/issues/28405#issuecomment-840914650 from @edgarbonillag.

If you are on 0.62

  1. add this line to your podfile (or modify it if you already had it):
    use_flipper!({'Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1'})
  2. change your package.json react-native dependency to
    "react-native": "0.62.3"
  3. do all the classic necessary cleans (node_modules, caches, pod folders, etc)(react-native-clean-project is your ally) then do yarn install and a pod install --repo-update (if pod install fails on an error about a Flipper package, just remove the relevant lines from the podfile.lock and run the pod install again)

If you are on 0.63

Note well: you need to be on latest 0.63.x release, at the time of writing 0.63.3.

If you are on 0.63, you are in luck! You just need to add this line to your podfile (or modify it if you already had it):

use_flipper!({'Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1'})

Then properly clean your caches (react-native-clean-project is your ally), remove pods folder and do a pod install --repo-update.

This should be enough for you to get Xcode 12.5 to work.

If you are on 0.64

  1. (optional) check your podfile.lock and make sure that Flipper is on 0.75 or higher, and Flipper-Folly is 2.5.3 or higher; if not, add this line to your podfile (or modify it if you already had it):
    use_flipper!({'Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1'})
  2. change your package.json react-native dependency to:
    "react-native": "0.64.1" // or higher
  3. do all the classic necessary cleans (node_modules, caches, pod folders, etc)(react-native-clean-project is your ally) then do yarn install and a pod install --repo-update (if pod install fails on an error about a Flipper package, just remove the relevant lines from the podfile.lock and run the pod install again)

These scenario have all been tested and βœ… so if you are still experiencing issues, it's likely that it's caused by some local configuration getting in the way. If that's the case, please refer to this comment by @smadan.


If none of the above helped you, and you can reproduce your issue consistently - even on a freshly init'd project, then post a comment below with how to repro so that this can be investigated further.

Dag0n commented 3 years ago

Debugger/DevTools is still not loading with these fixes in place.

info Opening flipper://null/Hermesdebuggerrn?device=React%20Native...
info Opening flipper://null/React?device=React%20Native...

appears in the terminal window but no windows open. Device M1 Macbook Pro

    "react": "17.0.1",
    "react-native": "0.64.1",
  - Flipper (~> 0.75.1)
  - Flipper-Folly (~> 2.5.3)
  - Flipper-RSocket (1.3.1):

E: If anyone has any workaround that'd be good as idb https://github.com/facebook/idb/issues/649 hasn't been updated to run on M1 and hermes is not supported on iOS simulator.

rbackhouse commented 3 years ago

My experience with following the instructions for a 0.62.2 project did not match what I actually had to do

1) My Podfile did not have a "use_flipper!" call but instead a "add_flipper_pods!" call. 2) The add_flipper_pods def is embedded in the Podfile.

For it to work I had to

1) Add require_relative '../node_modules/react-native/scripts/autolink-ios'

2) Remove the whole "def add_flipper_pods!(versions = {})" block and "def flipper_post_install(installer)" block

3) Change add_flipper_pods! to add_flipper_pods!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1')

With these change project now builds again.

mikehardy commented 3 years ago

Just a note for people running react-native builds on BitRise - it appears that BitRise restores caches as read-only by default and you need to delete the build cache after updating to 0.64.1 before the build will work, but then it will work repeatedly

That guess is based on this evidence

Hope this helps !

azuxx commented 3 years ago

Hi there, I followed all the instructions - also doing all the tasks of react-native-clean-project - but I have this build issue after upgrading from 0.63.4 to 0.64.1. What did I miss to do? Any help would be very helpful please

Screenshot 2021-05-07 at 17 46 10

ok build succeeded, fixed adding #import <React/RCTEventDispatcher.h> in an installed Pod πŸ˜…

Screenshot 2021-05-07 at 18 17 07
teajohnson90 commented 3 years ago

I am getting Flipper Parse Issue Expected function body after function declarator for react-native v0.63.2. I tried doing this several times, any ideas?

Edit: I just comment out the flipper lines and reverted back to my old code. I don't even know what flipper really does and if I even need it XD

drac94 commented 3 years ago

For RN 0.64.1 the fix works as long as you don't activate the Hermes engine, any ideas?

phithu commented 3 years ago

For RN 0.64.1 the fix works as long as you don't activate the Hermes engine, any ideas?

It work for me. My version RN: 0.64.1, Xcode: 12.5

kieran-osgood commented 3 years ago

For RN 0.64.1 the fix works as long as you don't activate the Hermes engine, any ideas?

Inline with @drac94 the proposed fix doesn't work for me unless I have disabled hermes, the weirdest part for me is I haven't even been using flipper so i commented out the

  # use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1')
  # post_install do |installer|
  #   flipper_post_install(installer)
  # end

And still have build failures?

Edit: I have tried all the steps above, including npx react-native-clean-project - honestly I'll admit this is beyond my knowledge so I'm not entirely sure what things could possibly be related to know where to start debugging - I see some people confirming their issues fixed but theres a good number of people building now seemingly still having issues, so I'm assuming I'm not just performing the steps incorrectly, perhaps theres something else regarding all this that isn't covered by 0.64.1?

mikehardy commented 3 years ago

Similar to @phithu I can confirm successful build 0.64.1 with Hermes on iOS with or without Flipper on Xcode 12.5

All I did was update package.json to reference 0.64.1 for react-native, and clean things locally.

It is of course possible there is some subtle interaction but 0.64.1 resolves all build problems for me, it should be possible so I would look very deeply at your local project and perhaps try npx react-native-clean-project if you have not

SandroMachado commented 3 years ago

With Hermes enable it's not working here. I tried to clean everything and still not working.

/Library/Developer/Xcode/DerivedData/Wallet-ejtiwpxblhntmaarqajjmdnuotzr/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/DistributedMutex.o RCT-Folly/folly/synchronization/DistributedMutex.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
angadp commented 3 years ago

Same issue even after all these steps. I need Hermes for react native reanimated.

angadp commented 3 years ago

https://xcodereleases.com/

Downgrade your Xcode.

uloco commented 3 years ago

@angadp

https://xcodereleases.com/

Downgrade your Xcode.

Downgrading XCode will not work if you need to test on a real iPhone and it is already updated to 14.5. Apple is no longer signing iOS 14.4, so you cannot downgrade your phone either.

kelset commented 3 years ago

@drac94 @kieran-osgood @SandroMachado @angadp Given that it seems that your reports are in contrast with the experience me, @phithu and @mikehardy and others had in testing Hermes + 0.64.1 + Xcode 12.5 I am inclined to think that there are specific issues in your local configurations that are leading to issues. Please try to replicate your issues on a clean project and/or create a series of reproduction steps - and open a dedicated new issue reporting that, so that it can be investigated further.

@teajohnson90 your issue seems unrelated to the problem here, but if it happens consistently I would suggest opting for upgrading to RN 64 - it's very unlikely that new patch releases will happen for 63.

drac94 commented 3 years ago

@kelset the problem is with a clean project

Steps I followed

npx react-native init ProjectName --template react-native-template-typescript
yarn install
npx pod-install ios
npx react-native run-ios

Result: Build error

RCT-Folly/folly/synchronization/DistributedMutex.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler

Adding use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1')

npx pod-install ios
npx react-native run-ios

Result: App builds ok and runs on emulator

Enabling Hermes

   use_react_native!(
     :path => config[:reactNativePath],
     # to enable hermes on iOS, change `false` to `true` and then install pods
-    :hermes_enabled => false
+    :hermes_enabled => true
   )
npx pod-install ios
npx react-native run-ios

Result: Build error

RCT-Folly/folly/synchronization/DistributedMutex.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler

@drac94 @kieran-osgood @SandroMachado @angadp Given that it seems that your reports are in contrast with the experience me, @phithu and @mikehardy and others had in testing Hermes + 0.64.1 + Xcode 12.5 I am inclined to think that there are specific issues in your local configurations that are leading to issues. Please try to replicate your issues on a clean project and/or create a series of reproduction steps - and open a dedicated new issue reporting that, so that it can be investigated further.

@teajohnson90 your issue seems unrelated to the problem here, but if it happens consistently I would suggest opting for upgrading to RN 64 - it's very unlikely that new patch releases will happen for 63.

mikehardy commented 3 years ago

@drac94 - ah ha!

https://github.com/react-native-community/react-native-template-typescript/blob/14a3f49da3fd76a410c4633514ec33654e6c71e5/template/package.json#L14

The problem you have is that react-native-template-typescript is not updated. Propose a PR to them, and in the meantime you'll have to patch that locally until it's using react-native 0.64.1 instead of 0.64.0

pedpess commented 3 years ago

Downgrading XCode to v12.4 worked as a temporary solution as well for RN v0.63

Download page: https://developer.apple.com/download/more/

drac94 commented 3 years ago

πŸ€¦β€β™‚οΈ never realized the typescript template was using RN 0.64.0, thank you so much @mikehardy

kieran-osgood commented 3 years ago

As an update to my issue incase it helps anyone - FINALLY got it resolved, I made a mistake in the upgrade process for 0.63.4 to 0.64.X - I forgot to add the line in the code snippet below - what a painful issue to have debugged - satisfying though I suppose πŸ˜‚ guess make sure you've done all of the upgrade steps correctly guys - and thanks for the help!

  post_install do |installer|
    // flipper_post_install(installer) // Remove this in favour of the line below
    react_native_post_install(installer) // I had missed adding this line!
  end
ahartzog commented 3 years ago

As an update to my issue incase it helps anyone - FINALLY got it resolved, I made a mistake in the upgrade process for 0.63.4 to 0.64.X - I forgot to add the line in the code snippet below - what a painful issue to have debugged - satisfying though I suppose πŸ˜‚ guess make sure you've done all of the upgrade steps correctly guys - and thanks for the help!

  post_install do |installer|
    flipper_post_install(installer)
    react_native_post_install(installer) // I had missed adding this line!
  end

Ah - I missed this change too! Subtle! For what it's worth, I don't think you're supposed to have both those lines in there.

See: https://react-native-community.github.io/upgrade-helper/?from=0.63.1&to=0.64.1

(Or just look at the raw podfile for 0.64.1 --> https://raw.githubusercontent.com/react-native-community/rn-diff-purge/release/0.64.1/RnDiffApp/ios/Podfile

Rebuilding now with this - hope it resolves my build issue!

Edit: now hitting a post-install permissions issue. Guessing it's something with my ruby install, but probably not related to the other problems in here.

kieran-osgood commented 3 years ago

@ahartzog Oops thanks, I didnt make it clear in there, I initially had copied it from a gif diff and then removed the + and - from start of line to opt for comment to make it clearer what I added, forgot to remove the other line - I'll edit the comment now

jessejjohnson commented 3 years ago

Is there a solution when version < 0.62? We're on react-native: '0.60.6' with upgrade not being an immediate option.

jeanremy commented 3 years ago

Be careful if you are on 0.63.x. You need to upgrade to 0.63.3, because according to the changelog, it adds the

Ability to set which configuration to enable flipper for when using use_flipper!

I was struggling with my 0.63.2 version, until I read this. Upgrading to 0.63.3 and following the guide (⬆️) did the trick for me. Hope it helps someone.

jessejjohnson commented 3 years ago

I was struggling with my 0.63.2 version, until I read this. Upgrading to 0.63.3 and following the guide (⬆️) did the trick for me.

This increases my fear that a solution for earlier versions (0.60.6 in my case) is currently not known 😬

kelset commented 3 years ago

@jeanremy thanks for your note, I've updated the original post to reflect that you need to be on 0.63.3 πŸ‘

@jessejjohnson no, there's no known solution for versions below 0.62, sorry.

blarz-bix commented 3 years ago
```ruby
use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1')

This partially worked. I also needed this to make it work.
![image](https://user-images.githubusercontent.com/75634952/118059139-0acd1c00-b34d-11eb-8d67-677e0a2facfc.png)
You can find more about it here https://stackoverflow.com/a/57195975/3250503
rdewolff commented 3 years ago

Any similar info about RN 0.61.5?

edgarbonillag commented 3 years ago

Hi @rdewolff, I'm running a project with RN v0.61.5 and this is what worked for me: https://github.com/facebook/react-native/issues/28405#issuecomment-840914650

MarkKoenig95 commented 3 years ago

I tried literally everything, I even ran into the same error with a freshly built react native project. Finally I found this thread and applied the suggestion here and finally fixed the problem.

I think the problem me and others on that thread were facing might possibly be related to NFPS Case Sensitive file systems see this issue I tried to clean out my system as much as safely possible doing everything short of completely reinstalling the OS and nothing worked. I even downgraded to Xcode 14.4 and still encountered the same error.

I hope this helps someone else who might be experiencing the same frustration I have been for the past 8 hours.

Next time I'm going to be a little more hesitant about updating XCode because this happens every time...

rdewolff commented 3 years ago

I tried literally everything, I even ran into the same error with a freshly built react native project. Finally I found this thread and applied the suggestion here and finally fixed the problem.

I think the problem me and others on that thread were facing might possibly be related to NFPS Case Sensitive file systems see this issue I tried to clean out my system as much as safely possible doing everything short of completely reinstalling the OS and nothing worked. I even downgraded to Xcode 14.4 and still encountered the same error.

I hope this helps someone else who might be experiencing the same frustration I have been for the past 8 hours.

Next time I'm going to be a little more hesitant about updating XCode because this happens every time...

Yeah, updating version is always full of surprises and usually takes a lot longer than planned. For me it us usually means a lot of trial and error.

jlandrum commented 3 years ago

This is embarrassing. This is easily the 8th issue I've had with React Native on iOS due to an Xcode update, and I can't count how many times outside of React Native. If someone has a contact within Apple, it needs to be brought up to them that they can't keep releasing breaking changes to Xcode.

mikehardy commented 3 years ago

I can't imagine any software company that would agree to stop releasing breaking changes, that's technically silly. The problem is that they bundle the SDK updates (new symbols for new iOS versions) with the IDE update. No idea why they do that, but that is the problem. Breaking change takes some time to adopt, but you can't wait to adopt the SDK updates because you need the new symbols to develop features they force you to develop for App Store access.

Separate the SDK updates from the IDE updates and we'd have less pressure while the rough edges were worked through.

xclidongbo commented 3 years ago

use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1') react native: 0.63.2

crash

xclidongbo commented 3 years ago

Podfile, Delete all of Flipper, worked for me.

Planetfunky commented 3 years ago

use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1') "react": "16.13.1", "react-native": "0.63.2",

Still craashing... I;ve been following this issue for quite a while. So I've pretty much have tried all suggestions.

sunnylqm commented 3 years ago

@Planetfunky Update to 0.63.3 first

Note well: you need to be on latest 0.63.x release, at the time of writing 0.63.3.

xclidongbo commented 3 years ago

use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1') "react": "16.13.1", "react-native": "0.63.2",

Still craashing... I;ve been following this issue for quite a while. So I've pretty much have tried all suggestions.

Podfile, Delete all of Flipper, pod install worked for me.

petegivens commented 3 years ago

Just a note for people running react-native builds on BitRise - it appears that BitRise restores caches as read-only by default and you need to delete the build cache after updating to 0.64.1 before the build will work, but then it will work repeatedly

That guess is based on this evidence

  • the build failed there during the pod post install hook, where the method signatures are patched to fix the build. The specific failure was an rb.sys_open failure with permission denied
  • knowing what the patch release was trying to do (edit files in the Pods directory in the post install hook), and guessing about the read-only restore hypothesis, the cache was deleted
  • rebuild then worked, and subsequent builds worked.

Hope this helps !

I ran into this locally and was able to resolve by simply deleting the Pods folder before running pod install

guychou7 commented 3 years ago

I had the same problem, after having tried without success several proposed solutions including that of @kelset I deleted hermes-engine just out of curiosity and wow he was the one to blame react-native-cli: 2.0.1 react-native: 0.64.0 in Podfile change hermes_enabled => true to hermes_enabled => false

use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )

Next remove Podfile.lock and run pod install

xclidongbo commented 3 years ago

@Planetfunky Update to 0.63.3 first

Note well: you need to be on latest 0.63.x release, at the time of writing 0.63.3.

update 0.63.4, but not work.

Jexim commented 3 years ago

Updated to 0.64.1 and it not work. All @kelset scenarios have all been tested but the bug is keeping. About @smadan scenarios, these fixes generate new bugs (and I think the hand change in Pods files is not a good idea).

I think I can downgrade xCode to 12.4 but I'm not sure about it will be normal to work with iOS 14.5.

PrimulaX commented 3 years ago

Upgraded to 0.64.1 but there was bunch of errors while building the app. Then I just did comment out use_flipper!() from Podfile and build succeeded. πŸ€”

southkeys commented 3 years ago

I'm running into this error when I run npx react-native run-ios

/Users/jonny/Documents/Projects/testApp/node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js:25
  );
  ^
SyntaxError: Unexpected token )
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
Command PhaseScriptExecution failed with a nonzero exit code

Here is my env

❯ npx react-native info
info Fetching system and libraries information...
System:
    OS: macOS 11.3.1
    CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
    Memory: 38.00 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 16.2.0 - ~/.asdf/installs/nodejs/16.2.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.13.0 - ~/.asdf/installs/nodejs/16.2.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
    Xcode: 12.5/12E262 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_77 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1 
    react-native: 0.64.1 => 0.64.1 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

I tried all of the solutions here, none worked. Any ideas ?

jeffpball commented 3 years ago

Hi @rdewolff, I'm running a project with RN v0.61.5 and this is what worked for me: #28405 (comment)

Hey @kelset, will you please consider putting this on your list above? This is the solution for Xcode 12.5 and RN 0.61.5. Great work @edgarbonillag

kelset commented 3 years ago

@jeffpball Good idea, added - thanks

taparicio commented 3 years ago

Hey all, I just wanted to leave a note. I'm running RN v0.63.4. The original solution in the issue ticket worked to build my project but the app was crashing upon startup in the iOS simulator. Looking at a few of the flipper GitHub issues I took a gamble on trying an upgraded flipper version...the following seemed to work in my case for RN 0.63.4

use_flipper!({ 'Flipper' => '0.87.0', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1' })

Hope this can help someone else!

matinzd commented 3 years ago

Hey all, I just wanted to leave a note. I'm running RN v0.63.4. The original solution in the issue ticket worked to build my project but the app was crashing upon startup in the iOS simulator. Looking at a few of the flipper GitHub issues I took a gamble on trying an upgraded flipper version...the following seemed to work in my case for RN 0.63.4

use_flipper!({ 'Flipper' => '0.87.0', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1' })

Hope this can help someone else!

I think it's nothing to do with Flipper because I disabled Flipper and my builds are still failing.

missing required module 'swiftshims'

ciari commented 3 years ago

tried all provided solutions, nothing worked. downgrading xcode to 12.4 with Podfile contains _useflipper!({ 'Flipper-Folly' => '2.2.0' }) builds without error. for downgrade; just download 12.4 from apple developer account, rename extracted xip, then run # sudo xcode-select -switch /Applications/Xcode.12.4.app you can use switch latest later.

cassidypignatello commented 3 years ago

Tried everything for 0.64.1 on XCode 12.5, still no luck. The build keeps failing consistently due to something with FBSDK:

** BUILD FAILED **

The following build commands failed:
    CompileSwift normal x86_64 /ios/Pods/FBSDKShareKit/FBSDKShareKit/FBSDKShareKit/Swift/Enums+Extensions.swift
    CompileSwift normal x86_64 /ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/Swift/FBLoginButton.swift
    CompileSwift normal x86_64 /ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/Swift/LoginConfiguration.swift
    CompileSwift normal x86_64 /ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/Swift/LoginManager.swift
    PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/cass/Library/Developer/Xcode/DerivedData/Speedoc-cpnprerptsolqnbbkqaumsxfhnud/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-AD85DDCBE42B0F530880C262082B23C0.sh
(5 failures)

What's strange is the x86_64 part of the error seems to refer to a problem with M1 MacBooks, but I'm on a MacBook Air 2020 (the Intel version, not the M1). Does anyone else know how to resolve this by any chance?

reaperdtme commented 3 years ago

Tried everything for 0.64.1 on XCode 12.5, still no luck. The build keeps failing consistently due to something with FBSDK:

** BUILD FAILED **

The following build commands failed:
  CompileSwift normal x86_64 /ios/Pods/FBSDKShareKit/FBSDKShareKit/FBSDKShareKit/Swift/Enums+Extensions.swift
  CompileSwift normal x86_64 /ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/Swift/FBLoginButton.swift
  CompileSwift normal x86_64 /ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/Swift/LoginConfiguration.swift
  CompileSwift normal x86_64 /ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/Swift/LoginManager.swift
  PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/cass/Library/Developer/Xcode/DerivedData/Speedoc-cpnprerptsolqnbbkqaumsxfhnud/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-AD85DDCBE42B0F530880C262082B23C0.sh
(5 failures)

What's strange is the x86_64 part of the error seems to refer to a problem with M1 MacBooks, but I'm on a MacBook Air 2020 (the Intel version, not the M1). Does anyone else know how to resolve this by any chance?

Here's the patch, works on 0.64.2 too

diff --git a/node_modules/react-native/scripts/react_native_pods.rb b/node_modules/react-native/scripts/react_native_pods.rb
index db9a34a..0a1700b 100644
--- a/node_modules/react-native/scripts/react_native_pods.rb
+++ b/node_modules/react-native/scripts/react_native_pods.rb
@@ -165,7 +165,8 @@ def use_react_native_codegen!(spec, options={})
   return if ENV['DISABLE_CODEGEN'] == '1'

   # The path to react-native (e.g. react_native_path)
-  prefix = options[:path] ||= File.join(__dir__, "..")
+  prefix = options[:path] ||= File.join("..", "..", "node_modules", "react-native")
+

   # The path to JavaScript files
   srcs_dir = options[:srcs_dir] ||= File.join(prefix, "Libraries")
@@ -208,7 +209,7 @@ def use_react_native_codegen!(spec, options={})
     :name => 'Generate Specs',
     :input_files => [srcs_dir],
     :output_files => ["$(DERIVED_FILE_DIR)/codegen-#{codegen_modules_library_name}.log"].concat(generated_files),
-    :script => "set -o pipefail\n\nbash -l -c '#{env_vars} CODEGEN_MODULES_LIBRARY_NAME=#{codegen_modules_library_name} #{File.join(__dir__, "generate-specs.sh")}' 2>&1 | tee \"${SCRIPT_OUTPUT_FILE_0}\"",
+    :script => "set -o pipefail\n\nbash -l -c '#{env_vars} CODEGEN_MODULES_LIBRARY_NAME=#{codegen_modules_library_name} #{File.join(prefix, "scripts", "generate-specs.sh")}' 2>&1 | tee \"${SCRIPT_OUTPUT_FILE_0}\"",
     :execution_position => :before_compile,
     :show_env_vars_in_log => true
   }

Made an issue for it https://github.com/facebook/react-native/issues/31664