Skip to content

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

@umang-simform

Description

@umang-simform

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: react-native-community/releases#235 (comment)
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

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