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.

Unable to build release version for iOS with the new architecture

See original GitHub issue

Description

I am unable to build release version for iOS with the new architecture. But I can build the debug version.

Here is build error

Undefined symbols for architecture x86_64:
  "folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::deferredReaders", referenced from:
      void folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::applyDeferredReaders<folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::WaitForever>(unsigned int&, folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::WaitForever&) in AppDelegate.o
      void folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::applyDeferredReaders<folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::WaitForever>(unsigned int&, folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::WaitForever&, unsigned int) in AppDelegate.o
  "folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::unlock()", referenced from:
      std::__1::unique_lock<folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false> >::~unique_lock() in AppDelegate.o
  "folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::~SharedMutexImpl()", referenced from:
      std::__1::__shared_ptr_emplace<facebook::react::ContextContainer const, std::__1::allocator<facebook::react::ContextContainer const> >::__on_zero_shared() in AppDelegate.o
ld: symbol(s) not found for architecture x86_64

Version

0.68.1

Output of npx react-native info

info Fetching system and libraries information...
System:
    OS: macOS 12.3.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 749.82 MB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 18.0.0 - ~/.nvm/versions/node/v18.0.0/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v18.0.0/bin/yarn
    npm: 8.6.0 - ~/.nvm/versions/node/v18.0.0/bin/npm
    Watchman: 2022.03.21.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /Users/wood/.rbenv/shims/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.1 AI-211.7628.21.2111.8309675
    Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.15 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.68.1 => 0.68.1
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce

  1. npx react-native init AwesomeTSProject --template react-native-template-typescript
  2. Run RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
  3. npx react-native run-ios --configuration Release

Snack, code example, screenshot, or link to a repository

Undefined symbols for architecture x86_64:
  "folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::deferredReaders", referenced from:
      void folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::applyDeferredReaders<folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::WaitForever>(unsigned int&, folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::WaitForever&) in AppDelegate.o
      void folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::applyDeferredReaders<folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::WaitForever>(unsigned int&, folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::WaitForever&, unsigned int) in AppDelegate.o
  "folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::unlock()", referenced from:
      std::__1::unique_lock<folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false> >::~unique_lock() in AppDelegate.o
  "folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::~SharedMutexImpl()", referenced from:
      std::__1::__shared_ptr_emplace<facebook::react::ContextContainer const, std::__1::allocator<facebook::react::ContextContainer const> >::__on_zero_shared() in AppDelegate.o
ld: symbol(s) not found for architecture x86_64

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

5reactions
fortmarekcommented, May 20, 2022

Is building release without flipper the best practice?

Flipper should never be in the release app but it should be done via compilation flags instead of commenting out Podfile. Check out the template app which already does a good job of stripping out Flipper when not in DEBUG.

4reactions
f-melonicommented, May 23, 2022

Is building release without flipper the best practice?

Flipper should never be in the release app but it should be done via compilation flags instead of commenting out Podfile. Check out the template app which already does a good job of stripping out Flipper when not in DEBUG.

👍🏻 I totally agree. I’ve tried to simplify the Flipper configuration, by bringing it into use_react_native, similarly to what we do for Fabric and Hermes, and I’ve used the flag production that is already available there to decide if add or not Flipper. That should solve this issue (even if is just a workaround), because if pod install is executed with production true, it won’t add the Flipper Pods at all (differently to what CocoaPods does currently, that adds it, but doesn’t copy it after is built), so Flipper won’t be compiled and won’t generate the mentioned error. I’m not fully familiar with this, so any feedback is welcome 😃 https://github.com/facebook/react-native/pull/33882

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't build to simulator on Apple Silicon
1) I've tried "pod install" & "pod update" with a Rosetta2 version of Terminal. Both complete without error, but Xcode still can't build....
Read more >
Prerequisites for Applications - React Native
There are a few prerequisites that should be addressed before the New Architecture is enabled in your application.
Read more >
iOS App was building fine yesterday, but it won't build today
1 Answer 1 · Update MacOS · Update Xcode and command lines tools · Run flutter pub upgrade , flutter pub get in...
Read more >
iOS Build Troubleshooting - Visual Studio App Center
The error could be caused by App Center building with the xcodeproj instead of the workspace. When adding CocoaPods to your project, switch...
Read more >
Xcode 12 Build Issues (iOS 14 Simulators, Archive) | Medium
arm64 architecture support & and Xcode 12 Compatible version have not been provided by many popular third party libraries yet (Like Firebase, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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