numandev1 / react-native-compressor

🗜️Compress Image, Video, and Audio same like Whatsapp 🚀✨
MIT License
949 stars 93 forks source link

Duplicate symbols iOS issue on React Native v0.74 #293

Open daholino opened 5 months ago

daholino commented 5 months ago

Issue

Hello, sorry if I am posting in the wrong GitHub repo but I have an issue while building the app after upgrading from RN v0.73.6 to 0.74.0. While linking React_Codegen I get an issue with 3 duplicate symbols as displayed below:

duplicate symbol '__ZN8facebook5react26NativeCompressorCxxSpecJSIC2ENSt3__110shared_ptrINS0_11CallInvokerEEE' in:
    /Users/tarik/Library/Developer/Xcode/DerivedData/gloCOM_GO-bgekhdweyipgqpctautxvuszkrvn/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/React-Codegen.build/Objects-normal/arm64/RNCompressorSpecJSI-generated.o
    /Users/tarik/Library/Developer/Xcode/DerivedData/gloCOM_GO-bgekhdweyipgqpctautxvuszkrvn/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/React-Codegen.build/Objects-normal/arm64/RNVideoCompressorSpecJSI-generated.o
duplicate symbol '__ZN8facebook5react23NativeCompressorSpecJSIC2ERKNS0_15ObjCTurboModule10InitParamsE' in:
    /Users/tarik/Library/Developer/Xcode/DerivedData/gloCOM_GO-bgekhdweyipgqpctautxvuszkrvn/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/React-Codegen.build/Objects-normal/arm64/RNCompressorSpec-generated.o
    /Users/tarik/Library/Developer/Xcode/DerivedData/gloCOM_GO-bgekhdweyipgqpctautxvuszkrvn/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/React-Codegen.build/Objects-normal/arm64/RNVideoCompressorSpec-generated.o
duplicate symbol '__ZN8facebook5react23NativeCompressorSpecJSIC1ERKNS0_15ObjCTurboModule10InitParamsE' in:
    /Users/tarik/Library/Developer/Xcode/DerivedData/gloCOM_GO-bgekhdweyipgqpctautxvuszkrvn/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/React-Codegen.build/Objects-normal/arm64/RNCompressorSpec-generated.o
    /Users/tarik/Library/Developer/Xcode/DerivedData/gloCOM_GO-bgekhdweyipgqpctautxvuszkrvn/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/React-Codegen.build/Objects-normal/arm64/RNVideoCompressorSpec-generated.o
ld: 3 duplicate symbols
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I think that these duplicate symbols come from this library. Do you have any ideas what to do here? I tried deleting Derived data folder, build folder and reinstalling everything. This issue is not present on v0.73.6 which is our current version.

This is our post_install hook in Podfile if it is relevant:

post_install do |installer|

  react_native_post_install(
    installer,
    $rnpath
  )

  installer.pods_project.build_configurations.each do |config|
    config.build_settings["CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES"] = true
  end

  installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
        config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = "YES"
        config.build_settings['SWIFT_SUPPRESS_WARNINGS'] = "YES"
      end

      create_symlink_phase = target.shell_script_build_phases.find { |x| x.name == 'Create Symlinks to Header Folders' }
      if create_symlink_phase
        create_symlink_phase.always_out_of_date = "1"
      end
  end

  end

Thank you!

Platform

React Native Version

v0.74.0

React Native Compressor Version

"react-native-compressor": "^1.8.24"
github-actions[bot] commented 5 months ago

👋 @daholino Thanks for opening your issue here! If you find this package useful hit the star🌟!

daholino commented 3 months ago

I've also tried with React Native 0.75.1 but I get the same error:

duplicate symbol '__ZN8facebook5react26NativeCompressorCxxSpecJSIC2ENSt3__110shared_ptrINS0_11CallInvokerEEE' in:
    /Users/tarik/Library/Developer/Xcode/DerivedData/gloCOM_GO-bgekhdweyipgqpctautxvuszkrvn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ReactCodegen.build/Objects-normal/x86_64/RNCompressorSpecJSI-generated.o
    /Users/tarik/Library/Developer/Xcode/DerivedData/gloCOM_GO-bgekhdweyipgqpctautxvuszkrvn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ReactCodegen.build/Objects-normal/x86_64/RNVideoCompressorSpecJSI-generated.o
duplicate symbol '__ZN8facebook5react23NativeCompressorSpecJSIC2ERKNS0_15ObjCTurboModule10InitParamsE' in:
    /Users/tarik/Library/Developer/Xcode/DerivedData/gloCOM_GO-bgekhdweyipgqpctautxvuszkrvn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ReactCodegen.build/Objects-normal/x86_64/RNCompressorSpec-generated.o
    /Users/tarik/Library/Developer/Xcode/DerivedData/gloCOM_GO-bgekhdweyipgqpctautxvuszkrvn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ReactCodegen.build/Objects-normal/x86_64/RNVideoCompressorSpec-generated.o
duplicate symbol '__ZN8facebook5react23NativeCompressorSpecJSIC1ERKNS0_15ObjCTurboModule10InitParamsE' in:
    /Users/tarik/Library/Developer/Xcode/DerivedData/gloCOM_GO-bgekhdweyipgqpctautxvuszkrvn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ReactCodegen.build/Objects-normal/x86_64/RNCompressorSpec-generated.o
    /Users/tarik/Library/Developer/Xcode/DerivedData/gloCOM_GO-bgekhdweyipgqpctautxvuszkrvn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ReactCodegen.build/Objects-normal/x86_64/RNVideoCompressorSpec-generated.o
ld: 3 duplicate symbols
clang: error: linker command failed with exit code 1 (use -v to see invocation)
jpancotti commented 3 months ago

Same issue with react native 0.74.0, and compressor 1.8.25.