leavez / cocoapods-binary

integrate pods in form of prebuilt frameworks conveniently, reducing compile time
MIT License
1.31k stars 206 forks source link

Duplicit linking of vendored framework #78

Open jakubvano opened 5 years ago

jakubvano commented 5 years ago

What's your environment:

 CocoaPods : 1.6.1
 Xcode : 10.2.1 (10E1001)
cocoapods-binary : 0.4.4
plugin 'cocoapods-binary'

A demo project is helpful: Unfortunatelly I can't attach demo project, as the Issue described below occurs with a private cocoapod, and I haven't been able to find analogous opensource example. I will try to provide a detailed description.

Issue Problematic podspec includes both static vendored framework & custom source code:

Pod::Spec.new do |spec|
    spec.name = 'MyFramework'
    spec.source_files  = 'src/*.{m,h,swift}'
    spec.vendored_frameworks  = 'VendoredFramework.framework"
end

When I install this without cocoapods-binary:

target 'MyApp' do
    pod 'MyFramework'
end

Everything works OK - specifically, generated Pods-MyApp.debug.xcconfig contains

OTHER_LDFLAGS = $(inherited) -framework "MyFramework"

However, when I install this with cocoapods-binary:

target 'MyApp' do
    pod 'MyFramework', :binary => true
end

I get duplicate symbols from VendoredFramework in runtime - included in both MyApp & MyFramework. Pods-MyApp.debug.xcconfig contains

OTHER_LDFLAGS = $(inherited) -framework "MyFramework" -framework "VendoredFramework"

When I remove -framework "VendoredFramework" from .xcconfig everything works fine again (until next pod install)