-->

Cocoapods : target has transitive dependencies tha

2020-08-16 03:07发布

问题:

I'm trying to install an objective-c Wrapper for Jsip 'VialerSIPLib' and use it in my swift project here is my pod

platform :ios, ’10.0’

use_frameworks!
target 'EMedicalAdmin' do
pod 'ObjectMapper', '~> 2.1'
pod 'Alamofire', '~> 4.3'
pod 'SwiftyAvatar', '~> 1.0'
pod 'AlamofireImage', '~> 3.1'
pod 'Eureka', '~> 2.0.0-beta.1'
pod 'JSQMessagesViewController', :git => 'https://github.com/jessesquires/JSQMessagesViewController.git', :branch => 'develop'
pod 'PKHUD', '~> 4.0'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'ImageSlideshow', '~> 1.1.0'
pod 'SwiftyJSON'
pod "FlexibleSteppedProgressBar"
pod 'BTNavigationDropdownMenu', :git => 'https://github.com/PhamBaTho/BTNavigationDropdownMenu.git', :branch => 'swift-3.0'
pod 'VialerSIPLib'
end

but i get this error when installing :-

target has transitive dependencies that include static binaries:

and if i remove

use_frameworks!

from my podfile it would work but all my other swift based pods won't work

so, i'm left with using only this one pod (VialerSIPLib) or Use all my other pods except it

回答1:

Please add this to your podspec: s.static_framework = true This is available from cocoapods version 1.4.0.

It worked for me.!!



回答2:

if any one is Still wondring ,it can't be Done

Using dynamic vendored frameworks shouldn't be a problem even if the developer isn't using CocoaPods with use_frameworks!, unless they for some reason need a static lib, such as if building a command line tool, where static linking is preferable.

So .You Could add the static library manually and link it in you project or wait for the vendor to Change the library into a dynamic Framework

More info here

For me this is how i solved it :-

1- Downloaded the static library using Cocoapods without use_frameworks!

2- used Carthage for Adding other libraries

3- and if a library Doesn't have a Carthage support i would do it manually (Not advised since alot of Duplicate dependencies may Appear)



回答3:

use_frameworks! should be enough but sometimes the pod.lock file gets corrupted.

So you can delete the pod.lock file and then do pod repo update and pod install



回答4:

I put up a repo to show how to do: https://github.com/Lucashuang0802/CocoaPodsWithCarthage

There are a couple things to do: - install your objective-c lib via CocoaPods without indicating use_framework! in the Podfile - install your pure Swift module via Carthage

You should be able to compile fine with this solution.