Skip to content

Unable to build release version for iOS with the new architecture #33764

Closed
@wood1986

Description

@wood1986

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions