13

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

Tarek hemdan
  • 874
  • 2
  • 10
  • 24
  • [the documentation for this pod](https://cocoapods.org/pods/VialerSIPLib) says it depends on `Vialer-pjsip-iOS`, `CocoaLumberjack` and `Reachability`. Do things get better for you when you add those three pods to your Podfile? – Michael Dautermann Apr 05 '17 at 16:16
  • @MichaelDautermann they already get installed automatically when i install the 'VialerSIBLib' – Tarek hemdan Apr 05 '17 at 16:18

5 Answers5

19

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

It worked for me.!!

kalafun
  • 3,512
  • 6
  • 35
  • 49
Pranav Gupta
  • 741
  • 9
  • 10
  • @PranavGupta: Can you please show me the code like where you put the `podspec: s.static_framework = true`. Sorry for the silly question, I am new to Cocoapods. Thank you – Luong Truong Oct 02 '19 at 14:53
  • 1
    @LuongTruong the only line you need to paste is "s.static_framework = true" Please dont forget to use this line at the top of the podspec file "Pod::Spec.new do |s|" – Pranav Gupta Oct 03 '19 at 16:44
  • @PranavGupta: Thank you for your comment, I found it :) – Luong Truong Oct 04 '19 at 07:21
  • @LuongTruong Where is it? I saw your question and did not get any clue. How can I edit a pod's podspec? – Faruk Jan 23 '20 at 17:09
  • @Faruk: Please follow this link https://stackoverflow.com/questions/58212049/ios-where-to-put-s-static-framework-true. Hope it help – Luong Truong Feb 07 '20 at 01:56
  • @LuongTruong yeah, that is thread I got here. However I could not find any .podspec for the pod I am trying to install. Can you explain the how did you locate it? – Faruk Feb 07 '20 at 12:38
  • @Faruk we cant access the podspec file of someone else's pod. It is not available with the Pod. Only the creator of framework or pod can access it. – Pranav Gupta Feb 09 '20 at 14:40
  • @Faruk: I am working in a React Native project, I found the podspec file in node_modules//ios – Luong Truong Feb 11 '20 at 06:38
  • Are there any bad implications that adding `s.static_framework` can have? – Teodor Ciuraru Oct 13 '20 at 17:11
2

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

Ali
  • 2,427
  • 22
  • 25
1

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)

Tarek hemdan
  • 874
  • 2
  • 10
  • 24
1

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.

Lucas Huang
  • 3,998
  • 3
  • 20
  • 29
  • A link to a solution is welcome, but please ensure your answer is useful without it: [add context around the link](//meta.stackexchange.com/a/8259) so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. [Answers that are little more than a link may be deleted.](//stackoverflow.com/help/deleted-answers) – Baum mit Augen Sep 13 '17 at 22:35
1

It's a weird one. For me uninstalling and installing again worked. Steps -

  1. Comment(#) the error causing pod in pod file
  2. Pod install
  3. Uncomment the line in pod file and save
  4. Pod install
Akash Shindhe
  • 558
  • 4
  • 16