Unable to build release version for iOS with the new architecture
See original GitHub issueDescription
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
- npx react-native init AwesomeTSProject --template react-native-template-typescript
- Run RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
- 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:
- Created a year ago
- Reactions:2
- Comments:17 (11 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 inDEBUG
.👍🏻 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 flagproduction
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 withproduction
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