12

将我的应用程序更新到 react-native v0.66.0 后,如果启用了 hermes,我会不断收到此错误。我试图删除 DerivedData 文件夹 podfile podfile.lock... 但没有任何帮助

终端输出

duplicate symbol 'folly::exception_wrapper::from_exception_ptr(std::exception_ptr&&)' in:
    /Users/cuongtd/Library/Developer/Xcode/DerivedData/MyApp-ekbbcdnefrapxuertuowclstsjop/Build/Products/Debug-iphonesimulator/Flipper-Folly/libFlipper-Folly.a(ExceptionWrapper.o)
    /Users/cuongtd/Library/Developer/Xcode/DerivedData/MyApp-ekbbcdnefrapxuertuowclstsjop/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/cuongtd/Library/Developer/Xcode/DerivedData/MyApp-ekbbcdnefrapxuertuowclstsjop/Build/Products/Debug-iphonesimulator/Flipper-Folly/libFlipper-Folly.a(ExceptionWrapper.o)
    /Users/cuongtd/Library/Developer/Xcode/DerivedData/MyApp-ekbbcdnefrapxuertuowclstsjop/Build/Products/Debug-iphonesimulator/RCT-Folly/libRCT-Folly.a(ExceptionWrapper.o)
duplicate symbol 'folly::exception_wrapper::onNoExceptionError(char const*)' in:
    /Users/cuongtd/Library/Developer/Xcode/DerivedData/MyApp-ekbbcdnefrapxuertuowclstsjop/Build/Products/Debug-iphonesimulator/Flipper-Folly/libFlipper-Folly.a(ExceptionWrapper.o)
    /Users/cuongtd/Library/Developer/Xcode/DerivedData/MyApp-ekbbcdnefrapxuertuowclstsjop/Build/Products/Debug-iphonesimulator/RCT-Folly/libRCT-Folly.a(ExceptionWrapper.o)
duplicate symbol 'folly::exceptionStr(folly::exception_wrapper const&)' in:
    /Users/cuongtd/Library/Developer/Xcode/DerivedData/MyApp-ekbbcdnefrapxuertuowclstsjop/Build/Products/Debug-iphonesimulator/Flipper-Folly/libFlipper-Folly.a(ExceptionWrapper.o)
    /Users/cuongtd/Library/Developer/Xcode/DerivedData/MyApp-ekbbcdnefrapxuertuowclstsjop/Build/Products/Debug-iphonesimulator/RCT-Folly/libRCT-Folly.a(ExceptionWrapper.o)
duplicate symbol 'folly::exception_wrapper::uninit_' in:
    /Users/cuongtd/Library/Developer/Xcode/DerivedData/MyApp-ekbbcdnefrapxuertuowclstsjop/Build/Products/Debug-iphonesimulator/Flipper-Folly/libFlipper-Folly.a(ExceptionWrapper.o)
    /Users/cuongtd/Library/Developer/Xcode/DerivedData/MyApp-ekbbcdnefrapxuertuowclstsjop/Build/Products/Debug-iphonesimulator/RCT-Folly/libRCT-Folly.a(ExceptionWrapper.o)
duplicate symbol 'folly::exception_wrapper::ExceptionPtr::ops_' in:
    /Users/cuongtd/Library/Developer/Xcode/DerivedData/MyApp-ekbbcdnefrapxuertuowclstsjop/Build/Products/Debug-iphonesimulator/Flipper-Folly/libFlipper-Folly.a(ExceptionWrapper.o)
    /Users/cuongtd/Library/Developer/Xcode/DerivedData/MyApp-ekbbcdnefrapxuertuowclstsjop/Build/Products/Debug-iphonesimulator/RCT-Folly/libRCT-Folly.a(ExceptionWrapper.o)
duplicate symbol 'folly::exception_wrapper::SharedPtr::ops_' in:
    /Users/cuongtd/Library/Developer/Xcode/DerivedData/MyApp-ekbbcdnefrapxuertuowclstsjop/Build/Products/Debug-iphonesimulator/Flipper-Folly/libFlipper-Folly.a(ExceptionWrapper.o)
    /Users/cuongtd/Library/Developer/Xcode/DerivedData/MyApp-ekbbcdnefrapxuertuowclstsjop/Build/Products/Debug-iphonesimulator/RCT-Folly/libRCT-Folly.a(ExceptionWrapper.o)
ld: 7 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

ios/podfile

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

target 'MyApp' do
  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
  )

  # Pods for MyApp
  pod 'Firebase/Analytics'
  pod 'AFNetworking', '~> 4.0', :source => 'https://github.com/ElfSundae/CocoaPods-Specs.git'

  use_flipper!()
  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)

    installer.aggregate_targets.each do |aggregate_target| 
      aggregate_target.user_project.native_targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['LIBRARY_SEARCH_PATHS'] = ['$(SDKROOT)/usr/lib/swift', '$(inherited)']
        end
      end
      aggregate_target.user_project.save
    end

    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
       end
    end
    `sed -i -e  $'s/__IPHONE_10_0/__IPHONE_12_0/' #{installer.sandbox.root}/RCT-Folly/folly/portability/Time.h`
  end
end

我想使用 Flipper 来调试我的应用程序并且启用了爱马仕,谢谢大家。

编辑:我可以从 Xcode 构建项目

4

1 回答 1

14

我现在可以通过删除成功运行项目

DEAD_CODE_STRIPPING = NO;

在项目.pbxproj

或转到Xcode中的构建设置选项卡,然后为调试模式启用死代码剥离

在此处输入图像描述

于 2021-10-14T04:24:40.810 回答