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
408 stars 109 forks source link

Error 163 duplicate symbols for architecture x86_64 on IOS #129

Open minhpd911992 opened 1 year ago

minhpd911992 commented 1 year ago

When i upgrade version 1.1.6 and run project ios. It has an error: 163 duplicate symbols for architecture x86_64 Linker command failed with exit code 1 (use -v to see invocation)

If i use version 0.4.9, it hasn't error My mac: Apple M1 Pro 16GB, Xcode 15, react native version 0.72.4

Please help me !

marcos-vinicius-mafei commented 1 year ago

Same problem here!

marcos-vinicius-mafei commented 1 year ago

@minhpd911992, have you found a solution for this?

marcos-vinicius-mafei commented 1 year ago

@baronha, can you take a look at this? Pls!

bizarrecoding commented 1 year ago

I use this library in conjunction with another that uses TOCropViewController. This library uses CropViewController, which is a swift wrapper for the TOCropViewController, so it generates a second set of duplicated files.

baronha commented 1 year ago

I use this library in conjunction with another that uses TOCropViewController. This library uses CropViewController, which is a swift wrapper for the TOCropViewController, so it generates a second set of duplicated files.

Yah sir. This is the right solution for us. If you need to open the Crop View Controller directly, that's in my TODO list:

Screenshot 2023-11-03 at 13 14 45

bizarrecoding commented 1 year ago

Assuming you use another library using TOCropViewController, you need to patch it to use CropViewController instead. In the other library podspec:

-  s.dependency 'TOCropViewController'
+  s.dependency 'CropViewController'

And within the library code replace any instance of TOCropViewController import:

-#import <TOCropViewController/TOCropViewController.h>
+#import <CropViewController/CropViewController.h>

with that, both libraries use the same dependency and will not generate duplicate files.

marcos-vinicius-mafei commented 1 year ago

Thank you so much @bizarrecoding! I will try your solution.