BaiduLBS / BaiduMapKit

百度地图 iOS SDK(官方)
MIT License
115 stars 51 forks source link

target has libraries with conflicting names: libcrypto.a and libssl.a. #21

Open EvoIos opened 7 years ago

EvoIos commented 7 years ago

CocoaPods Version: 1.2.1 BaiduMapKit : 3.3.2

Pods 集成不成功,报错:target has libraries with conflicting names: libcrypto.a and libssl.a.。因为工程里已经有其他库(如:支付宝SDK)包含 libcrypto.a and libssl.a 了,所以会导致 pod install 不成功,提示上面的错误。

请问这种情况,应该如何解决呢?

vance-liu commented 4 years ago

请问怎么解决,有没有自动化的方法,比如在pofile解决,像安卓的build gradle 可以exclude

vance-liu commented 4 years ago
pre_install do |installer|
    exclude_files = ['libssl', 'libcrypto']
    Dir.glob(File.join(installer.sandbox.pod_dir('BaiduMapKit'), '**', '*.a')).each do |bundle|
      if (exclude_files.include?(File.basename(bundle, ".a").downcase))
        puts "Removing #{bundle}"
        FileUtils.rm_rf(bundle)
      end
    end
  end
tcjxm7 commented 4 years ago
pre_install do |installer|
    exclude_files = ['libssl', 'libcrypto']
    Dir.glob(File.join(installer.sandbox.pod_dir('BaiduMapKit'), '**', '*.a')).each do |bundle|
      if (exclude_files.include?(File.basename(bundle, ".a").downcase))
        puts "Removing #{bundle}"
        FileUtils.rm_rf(bundle)
      end
    end
  end

太感谢了,终于解决了这个老顽疾。。。。