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.

duplicate symbol 'folly::exception_wrapper::from_exception_ptr(std::exception_ptr&&)' React Native 0.66 with hermes enabled

See original GitHub issue

Description

I was on 0.65.1 (with Hermes enabled) and tried to perform an upgrade to 0.66 today and after performing all necessary changes as mentioned in upgrade helper, I finally performed a clean install and tried to run the app and now it is not working anymore, It is throwing duplicate symbol errors related to flipper between RCT-folly and Flipper-folly. Also, I faced a similar issue when I upgraded to 0.65.1 but at that time this fix worked: https://github.com/react-native-community/releases/issues/235#issuecomment-863308604 I tried this here but doesn’t seems working Here is the error from Xcode:

duplicate symbol 'folly::detail::str_to_bool(folly::Range<char const*>*)' in:
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/Flipper-Folly/libFlipper-Folly.a(Conv.o)
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/RCT-Folly/libRCT-Folly.a(Conv.o)
duplicate symbol 'folly::makeConversionError(folly::ConversionCode, folly::Range<char const*>)' in:
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/Flipper-Folly/libFlipper-Folly.a(Conv.o)
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/RCT-Folly/libRCT-Folly.a(Conv.o)
duplicate symbol 'folly::exception_wrapper::from_exception_ptr(std::exception_ptr&&)' in:
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/Flipper-Folly/libFlipper-Folly.a(ExceptionWrapper.o)
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/RCT-Folly/libRCT-Folly.a(ExceptionWrapper.o)
duplicate symbol 'folly::exception_wrapper::from_exception_ptr(std::exception_ptr const&)' in:
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/Flipper-Folly/libFlipper-Folly.a(ExceptionWrapper.o)
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/RCT-Folly/libRCT-Folly.a(ExceptionWrapper.o)
duplicate symbol 'folly::exception_wrapper::onNoExceptionError(char const*)' in:
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/Flipper-Folly/libFlipper-Folly.a(ExceptionWrapper.o)
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/RCT-Folly/libRCT-Folly.a(ExceptionWrapper.o)
duplicate symbol 'folly::exceptionStr(folly::exception_wrapper const&)' in:
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/Flipper-Folly/libFlipper-Folly.a(ExceptionWrapper.o)
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/RCT-Folly/libRCT-Folly.a(ExceptionWrapper.o)
duplicate symbol 'folly::exception_wrapper::uninit_' in:
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/Flipper-Folly/libFlipper-Folly.a(ExceptionWrapper.o)
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/RCT-Folly/libRCT-Folly.a(ExceptionWrapper.o)
duplicate symbol 'folly::exception_wrapper::ExceptionPtr::ops_' in:
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/Flipper-Folly/libFlipper-Folly.a(ExceptionWrapper.o)
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/RCT-Folly/libRCT-Folly.a(ExceptionWrapper.o)
duplicate symbol 'folly::exception_wrapper::SharedPtr::ops_' in:
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/Flipper-Folly/libFlipper-Folly.a(ExceptionWrapper.o)
    /Users/umangloriya/Library/Developer/Xcode/DerivedData/App-gafjkayoxqdgqvdjhytxqqiubosa/Build/Products/Debug-iphonesimulator/RCT-Folly/libRCT-Folly.a(ExceptionWrapper.o)
ld: 9 duplicate symbols for architecture arm64

React Native version:

Run react-native info in your terminal and copy the results here.

System:
    OS: macOS 11.6
    CPU: (8) arm64 Apple M1
    Memory: 157.19 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.0.0 - /opt/homebrew/bin/node
    Yarn: 1.22.11 - /opt/homebrew/bin/yarn
    npm: 6.14.13 - /opt/homebrew/bin/npm
    Watchman: 4.9.0 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0
    Android SDK:
      API Levels: 23, 29, 30
      Build Tools: 29.0.2, 30.0.0, 30.0.2, 30.0.3
      System Images: android-30 | Google APIs ARM 64 v8a, android-S | Google APIs ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7678000
    Xcode: 13.0/13A233 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_292 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.66.0 => 0.66.0 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Upgrade to 0.66.0 with hermes enable for iOS 2.Build/Run the project

Expected Results

It should build/run just fine without throwing error

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

Here is my podfile

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

# Override Firebase SDK Version

platform :ios, '13.0'
install! 'cocoapods', :deterministic_uuids => false

target 'NotificationServiceExt' do
  pod 'Firebase/Messaging'
end

target 'App' do
  # Pods for App
  pod 'libwebp', :modular_headers => true
  # Add the pod for Firebase Cloud Messaging
  pod 'Firebase/Messaging'
  config = use_native_modules!
  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => true
  )
  # Enables Flipper.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:8
  • Comments:21 (1 by maintainers)

github_iconTop GitHub Comments

17reactions
Shywimcommented, Oct 15, 2021

We ended up recreating the ios project using a fresh react-native init, then readded everything to the iOS project (we also wrote a script like the one linked previously to automate this in case we need it: https://github.com/facebook/react-native/issues/32333#issuecomment-939939970) and it is set as YES by default: image

I confirm this is also not present in the pbxproj file anymore.

This is a change that occured in RN 0.62.0, this commit in particular : https://github.com/facebook/react-native/commit/e3218a0d965f6ec69cc31cd7c536678e165b96c1#diff-5e5f05dcdf7a14aea292c3172649e6a220923662fdb41d409997c37da721d27eL505, so I’m not sure it would cause debugging issues if this was a change related to Flipper. Even if I find it weird to activate this setting in a debug configuration, but whatever. XCode and pbxproj are a mess.

Switching it to NO on a new project bring back the problem with 9 duplicate symbols for architecture x86_64. Just wanted to provide context as to why only some people encoutered this issue, and why it works on a new project.

5reactions
escobar5commented, Oct 6, 2021

While this issue is addressed, you can disable flipper:

# use_flipper!({ ...

in your Podfile and reinstall Pods

Read more comments on GitHub >

github_iconTop Results From Across the Web

duplicate symbol 'folly::exception_wrapper ... - Stack Overflow
I want to use flipper to debug my app and hermes is enabled, thank all. Edit: I can build the project from Xcode....
Read more >
Using Hermes - React Native
Hermes is an open-source JavaScript engine optimized for React Native. ... you should see if Hermes is enabled in the welcome view:.
Read more >
[Solved]-"Duplicate symbol" with anything less than "-O2"
Coding example for the question "Duplicate symbol" with anything less than "-O2" ... React Native 0.66 with hermes enabled · Google/CloudMessaging' and ...
Read more >
duplicate symbols for architecture x86_64 react native - You.com
target 'tutorlab' do config = use_native_modules! use_react_native!( :path => config[:reactNativePath], # to enable hermes on iOS, change false to true and then ...
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