Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ios : duplicate symbol '_OBJC_CLASS_$_TOActivityCroppedImageProvider' #108

Closed
sarafhbk opened this issue Jun 7, 2023 · 14 comments
Closed

Comments

@sarafhbk
Copy link

sarafhbk commented Jun 7, 2023

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 'OBJC_CLASS$_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 'OBJC_METACLASS$_TOActivityCroppedImageProvider' in:
.......
.......

ld: 157 duplicate symbols for architecture x86_64`

@sarafhbk
Copy link
Author

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

@baronha
Copy link
Owner

baronha commented Jun 10, 2023

@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 wuxudong/react-native-charts-wrapper#604 (comment)

@sarafhbk
Copy link
Author

@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
Copy link
Owner

baronha commented Jun 12, 2023

@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
Copy link
Author

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

@baronha
Copy link
Owner

baronha commented Jun 13, 2023

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

@sarafhbk
Copy link
Author

sarafhbk commented Jun 13, 2023

`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
Copy link
Owner

baronha commented Jun 13, 2023

@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
Copy link
Author

@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
Copy link
Owner

baronha commented Jun 14, 2023

@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
Copy link
Author

sarafhbk commented Jun 14, 2023

@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
Copy link
Author

@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
Copy link

fukemy commented Jul 11, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants