baronha / react-native-multiple-image-picker

🏞 react-native-multiple-image-picker enables applications to pick images and videos from multiple smart albums in iOS/Android, similar to the current Facebook app.
MIT License
399 stars 107 forks source link

ios : duplicate symbol '_OBJC_CLASS_$_TOActivityCroppedImageProvider' #108

Closed sarafhbk closed 1 year ago

sarafhbk commented 1 year ago

ios build error after updating from 0.4.10 -> 1.0.0.

i tried all these steps

delete pod lock , remove pods and pod install remove derived data clean build

but no luck..

`duplicate symbol '_OBJCCLASS$_TOActivityCroppedImageProvider' in: /Users/saraf/Library/Developer/Xcode/DerivedData/UrduReader-hfoqbatrmtjnvkcmihfuiugtxjva/Build/Products/StageDebug-iphonesimulator/CropViewController/libCropViewController.a(TOActivityCroppedImageProvider.o) /Users/saraf/Library/Developer/Xcode/DerivedData/UrduReader-hfoqbatrmtjnvkcmihfuiugtxjva/Build/Products/StageDebug-iphonesimulator/TOCropViewController/libTOCropViewController.a(TOActivityCroppedImageProvider.o) duplicate symbol '_OBJCMETACLASS$_TOActivityCroppedImageProvider' in: ....... .......

ld: 157 duplicate symbols for architecture x86_64`

baronha commented 1 year ago

Please try to refer to the solutions below. Hope it will be useful:

sarafhbk commented 1 year ago

@baronha Thanks for the respons. I tried all these for the past 2 days, but nothing worked.

baronha commented 1 year ago

@baronha Thanks for the respons. I tried all these for the past 2 days, but nothing worked.

Have you tried this yet? https://stackoverflow.com/questions/52536380/why-do-i-get-ios-linker-errors-with-my-static-libraries and https://github.com/wuxudong/react-native-charts-wrapper/issues/604#issuecomment-548541820

sarafhbk commented 1 year ago

@baronha I already added the Swift file and headers.

the second link which u shared says add pod 'RNCharts', :path => '../node_modules/react-native-charts-wrapper', do we have anything like this for CropViewController?

baronha commented 1 year ago

@baronha I already added the Swift file and headers.

the second link which u shared says add pod 'RNCharts', :path => '../node_modules/react-native-charts-wrapper', do we have anything like this for CropViewController?

Absolutely OK. You should try that!

sarafhbk commented 1 year ago

@baronha what should i try? adding what in place of RNCharts?

baronha commented 1 year ago

Wait. I think this error is mainly in your Flipper configuration. Show me your Podfile

sarafhbk commented 1 year ago

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

platform :ios, min_ios_version_supported prepare_react_native_project!

project 'AppName', { 'StageDebug' => :debug, 'StageRelease' => :release, 'Debug' => :debug, 'Release' => :release }

flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled(['Debug', 'StageDebug', 'Release', 'StageRelease'], { 'Flipper' => '0.193.0' })

linkage = ENV['USE_FRAMEWORKS'] if linkage != nil Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green use_frameworks! :linkage => linkage.to_sym end

target 'AppName' do config = use_native_modules!

flags = get_default_flags()

use_react_native!( :path => config[:reactNativePath], :hermes_enabled => flags[:hermes_enabled], :fabric_enabled => flags[:fabric_enabled], :flipper_configuration => flipper_config, :app_path => "#{Pod::Config.instance.installation_root}/.." )

pod 'FirebaseCore', :modular_headers => true pod 'FirebaseCoreInternal', :modular_headers => true pod 'GoogleUtilities', :modular_headers => true pod 'RNSVG', :path => '../node_modules/react-native-svg' pod 'react-native-image-crop-tools', :path => '../node_modules/react-native-image-crop-tools' pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler' pod 'react-native-blob-util', :path => '../node_modules/react-native-blob-util' pod 'react-native-camera', :path => '../node_modules/react-native-camera', :modular_headers => true

target 'AppNameTests' do inherit! :complete end

post_install do |installer| react_native_post_install( installer, :mac_catalyst_enabled => false ) __apply_Xcode_12_5_M1_post_install_workaround(installer) installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'No' end end end

target 'share' do use_react_native!

pod 'RNShareMenu', :path => '../node_modules/react-native-share-menu'

end

permissions_path = '../node_modules/react-native-permissions/ios'

pod 'Permission-AppTrackingTransparency', :path => "#{permissions_path}/AppTrackingTransparency/Permission-AppTrackingTransparency.podspec" pod 'Permission-Camera', :path => "#{permissions_path}/Camera/Permission-Camera.podspec" pod 'Permission-MediaLibrary', :path => "#{permissions_path}/MediaLibrary/Permission-MediaLibrary.podspec" pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary/Permission-PhotoLibrary.podspec" end`

@baronha

baronha commented 1 year ago

@sarafhbk I think if you use this library it is not necessary to use additional pod 'react-native-image-crop-tools', :path => '../node_modules/react-native-image-crop-tools'

sarafhbk commented 1 year ago

@baronha after removing the pod 'react-native-image-crop-tools', :path => '../node_modules/react-native-image-crop-tools' also the error still remains. i use this package because i need a standalone image cropper for edit image feature.

baronha commented 1 year ago

@baronha after removing the pod 'react-native-image-crop-tools', :path => '../node_modules/react-native-image-crop-tools' also the error still remains. i use this package because i need a standalone image cropper for edit image feature.

standalone image cropper will be deployed in the future in react-native-multiple-image-picker@latest. Back to the above error. You have deleted Podfile.lock & /Pod and re-installed pod-install

sarafhbk commented 1 year ago

@baronha yes i did delete the pods, pod.lock and pod install still the same issue. I think the issue might be both packages use TOActivityCroppedImageProvider in common.

sarafhbk commented 1 year ago

@baronha do u suggest anything? im stuck with this issue for a very long time. everytime i had to change the version for ios and then make builds

fukemy commented 1 year ago

this error say that you have duplicate class named like TOActivityCroppedImageProvider, let search and find another lib use this class.

  1. If you does not tend to use this lib that have same class too, just remove it, then problem will gone
  2. If you must do this, so you need to fork one lib as local library then modify the filename