0

Recently I bump the google-cast-sdk to the latest, while got this kind of build error as below

  /Users/kxue/Documents/ios_trunk/Pods/google-cast-sdk/GoogleCastSDK-ios-4.4.7_static/GoogleCast.framework/GoogleCast(filterkit_2a008340bdfaacbcf917e42c4c119879.o)
  /Users/kxue/Documents/ios_trunk/Pods/google-cast-sdk/GoogleCastSDK-ios-4.4.7_static/GoogleCast.framework/GoogleCast(filterkit_1da3186a05aea8fa769cea2058201358.o)
duplicate symbol '_lrsFilterUp' in:
  /Users/kxue/Documents/ios_trunk/Pods/google-cast-sdk/GoogleCastSDK-ios-4.4.7_static/GoogleCast.framework/GoogleCast(filterkit_2a008340bdfaacbcf917e42c4c119879.o)
  /Users/kxue/Documents/ios_trunk/Pods/google-cast-sdk/GoogleCastSDK-ios-4.4.7_static/GoogleCast.framework/GoogleCast(filterkit_1da3186a05aea8fa769cea2058201358.o)

...

ld: 10 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

any idea how to slove this? it doesn't happen when I use the previous version, google-cast-sdk 4.2.0, thanks~

whitekevin
  • 311
  • 3
  • 15

2 Answers2

0

This worked for me.

  1. Select your iOS target in your project.
  2. Select Build Settings
  3. search for "Other linker flags"
  4. double click on "other linker flags", it should pop up a list. If you see "-all_load" as an entry, remove it and try build again.
Byron
  • 1,091
  • 11
  • 27
0

I had the same issue, but my case was because of how my internal SDK podspec was being setup. Based on Byron's answer I setup the subspec as follows

s.subspec "SomeSubspec" do |sp|

  sp.platform = :ios

  // block of code to link flags according to Google Cast documentation
  // make sure to not include -all_load
  sp.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-ObjC -lc++' }
  sp.xcconfig = { 'ENABLE_BITCODE' => 'NO' }

  sp.frameworks = "framework1", "framework2"
  sp.source_files  = "somepath/*.swift"

  sp.dependency InternalSDK/Somesubspec
  sp.ios.dependency 'google-cast-sdk', '4.4.8'
  sp.ios.dependency anotherpod, '3.19.1'

  sp.test_spec "Tests" do |test_spec|
    // block of code to link flags according to Google Cast documentation
    // make sure to not include -all_load
    test_spec.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-ObjC -lc++' }
    test_spec.xcconfig = { 'ENABLE_BITCODE' => 'NO' }
    test_spec.requires_app_host = true
    test_spec.source_files = "somepath/*.swift"
  end
end
gyosida
  • 450
  • 4
  • 17