google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://mediapipe.dev
Apache License 2.0
26.09k stars 5.04k forks source link

Xcode: Duplicate Symbols (Conflicts with MLKit dependencies) #5342

Open shindgewongxj opened 2 months ago

shindgewongxj commented 2 months ago

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

No

OS Platform and Distribution

iOS 14+

MediaPipe Tasks SDK version

0.10.12

Task name (e.g. Image classification, Gesture recognition etc.)

Vision

Programming Language and version (e.g. C++, Python, Java)

Swift

Describe the actual behavior

Failed to build or run

Describe the expected behaviour

Build Success

Standalone code/steps you may have used to try to get what you need

Pods:

target 'Project' do
  use_frameworks!
  pod 'GoogleMLKit/FaceDetection'
  pod 'MediaPipeTasksVision'
end

### Other info / Complete Logs

```shell
ld: <numbers> duplicate symbols
clang: error: linker command failed with exit code 1 (use -v to see invocation)
priankakariatyml commented 1 month ago

Can you give us more details to investigate?

  1. The complete error message including a list of the duplicated symbols.
  2. Versions of GoogleMLKit and MediaPipeTasksVision installed from your Podfile.lock
shindgewongxj commented 1 month ago

Thanks for your help, here's some additions!

Error Messeages:

Some of duplicate symbols:

duplicate symbol 'google::protobuf::internal::WireFormatLite::EnumSize(google::protobuf::RepeatedField<int> const&)' in: 
    ProjectPath/Pods/MediaPipeTasksCommon/frameworks/graph_libraries/libMediaPipeTasksCommon_device_graph.a(wire_format_lite.o)
    Xcode/DerivedData/bxgztldalnfoeqcgjpzhxteijnxv/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/MediaPipeTasksCommon/MediaPipeTasksCommon.framework/MediaPipeTasksCommon(wire_format_lite.o)
duplicate symbol 'google::protobuf::internal::WireFormatLite::SInt32Size(google::protobuf::RepeatedField<int> const&)' in:
    SamePath/libMediaPipeTasksCommon_device_graph.a(wire_format_lite.o)
    SamePath/MediaPipeTasksCommon/MediaPipeTasksCommon.framework/MediaPipeTasksCommon(wire_format_lite.o)
duplicate symbol 'google::protobuf::internal::WireFormatLite::Int32Size(google::protobuf::RepeatedField<int> const&)' in:
    SamePath/libMediaPipeTasksCommon_device_graph.a(wire_format_lite.o)
    SamePath/MediaPipeTasksCommon/MediaPipeTasksCommon.framework/MediaPipeTasksCommon(wire_format_lite.o)
duplicate symbol 'google::protobuf::internal::WireFormatLite::ReadBytes(google::protobuf::io::CodedInputStream*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>**)' in:
    SamePath/libMediaPipeTasksCommon_device_graph.a(wire_format_lite.o)
    SamePath/MediaPipeTasksCommon/MediaPipeTasksCommon.framework/MediaPipeTasksCommon(wire_format_lite.o)
duplicate symbol 'google::protobuf::internal::WireFormatLite::ReadBytes(google::protobuf::io::CodedInputStream*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)' in:
    SamePath/MediaPipeTasksCommon/frameworks/graph_libraries/libMediaPipeTasksCommon_device_graph.a(wire_format_lite.o)
    SamePath/MediaPipeTasksCommon/MediaPipeTasksCommon.framework/MediaPipeTasksCommon(wire_format_lite.o)
duplicate symbol 'mediapipe::tasks::AddPayload(absl::Status, std::__1::basic_string_view<char, std::__1::char_traits<char>>, mediapipe::tasks::MediaPipeTasksStatus)' in:
    SamePath/MediaPipeTasksCommon/frameworks/graph_libraries/libMediaPipeTasksCommon_device_graph.a(common.o)
    SamePath/MediaPipeTasksCommon/MediaPipeTasksCommon.framework/MediaPipeTasksCommon(common.o)
duplicate symbol 'mediapipe::tasks::CreateStatusWithPayload(absl::StatusCode, std::__1::basic_string_view<char, std::__1::char_traits<char>>, mediapipe::tasks::MediaPipeTasksStatus)' in:
    SamePath/MediaPipeTasksCommon/frameworks/graph_libraries/libMediaPipeTasksCommon_device_graph.a(common.o)
    SamePath/MediaPipeTasksCommon/MediaPipeTasksCommon.framework/MediaPipeTasksCommon(common.o)

Podfile Frameworks:

target 'Project' do
  use_frameworks!
  pod 'GoogleMLKit/FaceDetection'
  pod 'MediaPipeTasksVision'
end

Dependencies:

Dependency Version
GTMSessionFetcher 3.4.1
GoogleDataTransport 9.4.1
GoogleMLKit 6.0.0
GoogleToolboxForMac 4.2.1
GoogleUtilities 7.13.2
MLImage 1.0.0-beta5
MLKitCommon 11.0.0
MLKitFaceDetection 5.0.0
MLKitVision 7.0.0
MediaPipeTasksCommon 0.10.13
MediaPipeTasksVision 0.10.13
PromisesObjC 2.4.0
nanopb 2.30910.0