question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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'})
  1. change your package.json react-native dependency to
"react-native": "0.62.3"
  1. 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'})
  1. change your package.json react-native dependency to:
"react-native": "0.64.1" // or higher
  1. 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.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:319
  • Comments:147 (14 by maintainers)

github_iconTop GitHub Comments

50reactions
mikehardycommented, Aug 20, 2021

Here’s my full set of hacks.

  post_install do |installer|
    react_native_post_install(installer)

    # Apple Silicon builds require a library path tweak for Swift library discovery or "symbol not found" for swift things
    installer.aggregate_targets.each do |aggregate_target| 
      aggregate_target.user_project.native_targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['LIBRARY_SEARCH_PATHS'] = ['$(SDKROOT)/usr/lib/swift', '$(inherited)']
        end
      end
      aggregate_target.user_project.save
    end

     # Flipper requires a crude patch to bump up iOS deployment target, or "error: thread-local storage is not supported for the current target"
    # I'm not aware of any other way to fix this one other than bumping iOS deployment target to match react-native (iOS 11 now)
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
       end
    end

    # ...but if you bump iOS deployment target, Flipper barfs again "Time.h:52:17: error: typedef redefinition with different types"
    # We need to make one crude patch to RCT-Folly - set `__IPHONE_10_0` to our iOS target + 1
    # https://github.com/facebook/flipper/issues/834 - 84 comments and still going...
    `sed -i -e  $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h`
  end
25reactions
rbackhousecommented, May 5, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native 0.64 won't build iOS app after updating Xcode to ...
Xcode 12.5 troubleshooting guide (RN 0.61/0.62/0.63/0.64) ... just comment out the flipper line in a pod and in Xcode also if you are...
Read more >
Framework Not Found with xcode 12 | Apple Developer Forums
With xcode 12 first time build fails for working project with previously installed cocoapods framework: ld: framework not found Pods_CopticFind
Read more >
Xcode 12.5 troubleshooting for React-Native "0.62.2" - Part 4
5. Then properly clean your caches (react-native start --reset-cache), then do a "pod install --repo-update". This should be enough for you to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found