Prevent duplicate symbols when building static library with Cocoapods

后端 未结 6 1388
天涯浪人
天涯浪人 2020-12-07 21:32

While I\'ve seen many questions dealing with Cocoapods and static libraries, most of them seem to assume you\'ll eventually have a single workspace with your static library

6条回答
  •  萌比男神i
    2020-12-07 21:39

    With reference from http://guides.cocoapods.org/syntax/podfile.html#post_install & http://pdx.esri.com/blog/2013/12/13/namespacing-dependencies/

    I use the 'Manually Rename All of the Symbols' approach. I was experiencing the duplicate symbol _OBJC_METACLASS_$_PodsDummy_Pods and so i added and edited the post_install in the Podfile to something like that to avoid the duplicate symbol

    post_install do |installer_representation|
        installer_representation.pods_project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited), PodsDummy_Pods=SomeOtherNamePodsDummy_Pods'
            end
        end
    end
    

提交回复
热议问题