Cocoapods : target has transitive dependencies that include static binaries when installing 'VialerSIPLib' - ios

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

Please add this to your podspec: s.static_framework = true
This is available from cocoapods version 1.4.0.
It worked for me.!!

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

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)

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.

It's a weird one.
For me uninstalling and installing again worked.
Steps -
Comment(#) the error causing pod in pod file
Pod install
Uncomment the line in pod file and save
Pod install

Related

Unable to install pod 'FBSDKLoginKit' Completely It just stop there

The pods are taking forever to install. They just stop there. I tried it for 30mins and also tried to make it work on dummy project but still the install was not successful. My podfile looks like this.
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'Benefit' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Benefit
pod 'Spring', :git => 'https://github.com/MengTo/Spring.git'
pod 'ImageSlideshow', '~> 1.4'
pod 'MIBadgeButton-Swift', :git => 'https://github.com/mustafaibrahim989/MIBadgeButton-Swift.git', :branch => 'master'
pod 'Charts'
pod 'SideMenu'
pod 'JTHamburgerButton', '~> 1.0'
pod 'SwiftyJSON'
pod 'Alamofire'
pod 'Google/SignIn'
pod 'GoogleSignIn'
pod 'FBSDKLoginKit'
end
Terminal output
Analyzing dependencies
Downloading dependencies
Using Alamofire (4.6.0)
Installing Bolts (1.9.0)
Using Charts (3.0.4)
Installing FBSDKCoreKit (4.29.0)
Installing FBSDKLoginKit (4.29.0)
-
Well I kept the terminal as it was and after an hour It was done with installing, I think there was a problem on server side of pods.
Just check your internet connection. And speed up Your net connection.
Happy coding :)

Xcode can't find interface declaration after running "pod install"

I've inherited an iOS project which uses cocoapods.
The repo includes the Pods directory with all the necessary pods frozen in time. If I clone the repo and build the app, all is fine. If I run pod update and then build, I get an error:
Cannot find interface declaration for COOperation.
The issue seems to be with a library called CompositeOperations, which is pulled in from a specific git account (not from cocoapods directly - not sure if that matters but just trying to give as much info as possible). Xcode is finding the library just fine, but for some reason it's not loading the Class declared in the interface file.
It seems silly to me to include the Pods directory in the repo. I feel like developers should clone the repo and then issue git install in order to pull down all dependancies.
Any suggestions for what I need to tweak in order for Xcode to successfully build my project?
The actual error in MessageScreenDataFetchOperation.h is:
/Users/user/src/myapp/myapp-iOS/Classes/Shared/Operations/MessageScreenDataFetchOperation.h:13:46:
Cannot find interface declaration for 'COOperation', superclass of
'MessageScreenDataFetchOperation'; did you mean 'NSOperation'?
And here's what MessageScreenDataFetchOperation.h looks like:
#import <CompositeOperations/COOperation.h>
#protocol GroupRef;
#interface MessageScreenDataFetchOperation : COOperation
- (id)initWithMessageId:(NSNumber *)messageId group:(id <GroupRef>)groupRef memberId:(NSNumber *)memberId;
#end
Here's my Podfile:
platform :ios, '8.0'
source 'https://github.com/CocoaPods/Specs.git'
target :MyTarget do
pod 'RestKit', '~> 0.24.0'
pod 'CompositeOperations', :git => 'https://github.com/stanislaw/CompositeOperations.git'
pod 'MBProgressHUD', '~> 0.8'
pod 'EKKeyboardAvoiding', '~> 2.0'
pod 'RBStoryboardLink', '0.1.0'
pod 'SWRevealViewController', '~> 2.0.0'
pod 'youtube-ios-player-helper', :git => 'https://github.com/stanislaw/youtube-ios-player-helper', :branch => '0.1.1-and-no-ads'
pod 'SZTextView'
pod 'MagicKit', :git => 'https://github.com/stanislaw/MagicKit'
pod 'ECPhoneNumberFormatter', :git => 'https://github.com/enriquez/ECPhoneNumberFormatter.git'
pod 'SSKeychain'
pod 'Mantle'
pod 'RSEnvironment', :git => 'https://github.com/rabovik/RSEnvironment'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
# Analytics
pod 'FlurrySDK', '5.1.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'NewRelicAgent'
# Logging
pod 'EchoLogger', :git => 'https://github.com/stanislaw/EchoLogger'
pod 'AFNetworkingLogger', :git => 'https://github.com/stanislaw/AFNetworkingLogger'
end
target :MyTargetUnitTests do
pod 'OCMock', '~> 3.0'
pod 'Kiwi'
pod 'JPSimulatorHacks', :git => 'https://github.com/plu/JPSimulatorHacks'
end
Have you tried adding CompositeOperations without using pods? That pod seems outdated to cocoapods:
https://cocoapods.org/?q=CompositeOperations
Turns out the version that was baked in to the Xcode project was a much older version. The Podfile didn't restrict by version number, so running 'pod update' updated the library to the latest version, which had significant changes, making it incompatible with my code base.
I figured it out by diffing Podfile.lock after running pod update and noticing the drastic difference in versions.
I went forward with deleting the Pods directory and the .xcworkspace file, but amended the Podile to restrict the library based off a specific tag.

Pod install displaying error in cocoapods version 1.0.0.beta.1

My podfile was working but after updating to cocoapods version 1.0.0.beta.1
pod install displays following error
MacBook-Pro:iOS-TuneIn home$ pod install
Fully deintegrating due to major version update
Deleted 1 'Copy Pods Resources' build phases.
Deleted 1 'Check Pods Manifest.lock' build phases.
Deleted 1 'Embed Pods Frameworks' build phases.
- libPods.a
- Pods.debug.xcconfig
- Pods.release.xcconfig
Deleted 1 'Copy Pods Resources' build phases.
Deleted 1 'Check Pods Manifest.lock' build phases.
- libPods.a
Deleted 1 'Copy Pods Resources' build phases.
Deleted 1 'Check Pods Manifest.lock' build phases.
- libPods.a
Deleted 1 'Copy Pods Resources' build phases.
Deleted 1 'Check Pods Manifest.lock' build phases.
- libPods.a
Deleted 1 'Copy Pods Resources' build phases.
Deleted 1 'Check Pods Manifest.lock' build phases.
- libPods.a
- libPods.a
Deleted 1 empty `Pods` groups from project.
Removing `Pods` directory.
Project has been deintegrated. No traces of CocoaPods left in project.
Note: The workspace referencing the Pods project still remains.
Updating local specs repositories
Analyzing dependencies
[!] The dependency `AFNetworking (= 2.6.3)` is not used in any concrete target.
The dependency `MBProgressHUD (~> 0.9.1)` is not used in any concrete target.
The dependency `PDKeychainBindingsController (~> 0.0.1)` is not used in any concrete target.
The dependency `FMDB/SQLCipher` is not used in any concrete target.
The dependency `ZXingObjC (~> 3.1.0)` is not used in any concrete target.
The dependency `SDWebImage (~> 3.7.2)` is not used in any concrete target.
The dependency `SignalR-ObjC (~> 2.0.0.beta3)` is not used in any concrete target.
The dependency `CJPAdController (from `https://github.com/nabeelarif100/CJPAdController.git`)` is not used in any concrete target.
The dependency `ECSlidingViewController (~> 2.0.3)` is not used in any concrete target.
The dependency `VGParallaxHeader` is not used in any concrete target.
The dependency `EMString` is not used in any concrete target.
The dependency `Google/SignIn` is not used in any concrete target.
The dependency `VIPhotoView (~> 0.1)` is not used in any concrete target.
The dependency `EncryptedCoreData (from `https://github.com/project-imas/encrypted-core-data.git`)` is not used in any concrete target.
MacBook-Pro:iOS-TuneIn home$
Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
pod 'AFNetworking', '2.6.3'
pod 'MBProgressHUD', '~> 0.9.1'
pod 'PDKeychainBindingsController', '~> 0.0.1'
pod 'FMDB/SQLCipher'
pod 'ZXingObjC', '~> 3.1.0'
pod 'SDWebImage', '~>3.7.2'
pod 'SignalR-ObjC','~>2.0.0.beta3'
pod 'CJPAdController', :git => 'https://github.com/nabeelarif100/CJPAdController.git'
pod 'ECSlidingViewController', '~> 2.0.3'
pod 'VGParallaxHeader'
pod 'EMString'
pod 'Google/SignIn'
pod 'VIPhotoView', '~> 0.1'
pod 'EncryptedCoreData', :git => 'https://github.com/project-imas/encrypted-core-data.git'
You have to specify a target for each pod.
e.g. if before you had your Podfile written like this:
pod 'Alamofire', '~> 3.1.4'
pod 'SwiftyJSON', '~> 2.3.2'
just change it to
target "TargetName" do
pod 'Alamofire', '~> 3.1.4'
pod 'SwiftyJSON', '~> 2.3.2'
end
After the new changes to cocoapods, You have to add the following lines to your podfile.
target "YOUR_PROJECT_NAME" do
pod "YOUR_POD"
end
From the CocoaPods website:
CocoaPods provides a pod init command to create a Podfile with smart defaults. You should use it.
you must add target 'your target' do and end around you pod like below.
target 'your target' do
pod 'AFNetworking', '2.6.3'
pod 'MBProgressHUD', '~> 0.9.1'
pod 'PDKeychainBindingsController', '~> 0.0.1'
end
plus: You may be need remove the pods dir, Podfile.lock and xcworkspace file, run the pod install again.
I got the same issue today. For mitigation, I unintall cocoapod, then install again version 0.39.
here is the link how to uninstall: https://superuser.com/questions/686317/how-to-fully-uninstall-the-cocoapods-from-the-mac-machine
This answer does not fix the root cause, but can get you unblocked. I don't have enough reputation to leave comments, so I put an answer here to unblock you.
I was this operation in the podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
target "targetprojectname" do
pod "AFNetworking"
end
My podfile was formatted correctly, so the answer did not work for me. What I had to do was all of the following:
First,
gem uninstall cocoapods
rvm get stable --auto-dotfiles
rvm use ruby-2.1.2
rvm osx-ssl-certs update all
rvm rubygems latest
sudo gem sources -r https://rubygems.org/
sudo gem sources -a http://rubygems.org/
gem install cocoapods -v 1.0.0.beta.1 --pre -V
I had SSL errors, timeout errors, and path errors. This fixed all of these. I am adding this answer in hopes that it will help someone - most people with this issue will NOT need to go through all of these steps, and should not do so if it is not neccesary. Keep in mind, that this is changing the d/l link to not use https, so be sure to change it back once you have resolved this issue. This, this, and this Stack Overflow question helped me finally resolve these issues.
I have the same problem, and even I changed to
target "TargetName" do
pod 'Alamofire', '~> 3.1.4'
pod 'SwiftyJSON', '~> 2.3.2'
end
It seems has some cache problem, it always read old version of PodFile, even I remove PodFile, the same error show up. It's weird.
However, when I open a new terminal , running pod install, it works.
1) Add and Open Podfile in Xcode instead of TextEdit or any other editor. (Syntax highlighting while viewing a pod file will simplify the process of finding syntax errors)
2) Add project dependancies as follows in your Podfile
def pods
pod 'AFNetworking', '~> 2.6'
pod 'ORStackView', '~> 3.0'
pod 'SwiftyJSON', '~> 2.3'
end
3) Add above define pods in project target as follows
target 'App_Target_Name' do
pods
end
for New version of cocoapods i.i 1.0.1
pod 'SlideMenuControllerSwift'
pod 'SDWebImage'
pod 'SearchTextField'
I was getting error:
The dependency SlideMenuControllerSwift is not used in any concrete target.
The dependency SDWebImage is not used in any concrete target.
The dependency SearchTextField is not used in any concrete target.
than i changed it to
target "YOUR_PROJECT_NAME" do
pod "YOUR_POD"
end
than it worked
Pod file is just a ruby file, you need to specify required pod for all target.
one of the available solution is to define all required pods in shared_pos, and use that for each target.
For ex:
Podfile
platform :ios, '9.0'
use_frameworks!
def Shared_Pods
pod 'Quick', '0.5.0'
pod 'Nimble', '2.0.0-rc.1'
end
target 'MyMainTarget' do
Shared_Pods
end
target 'MyUITests' do
Shared_Pods
end
platform :ios, '8.0'
target 'YourTargetName' do
ALL PODS HERE
end
open terminal, go to project folder and enter code
pod update

Error running pod install with swift

I followed the instruction from Cocoapods.
Below is my Podfile:
platform :ios, '8.2'
pod 'SwiftyJSON', '~> 2.1'
pod 'SwiftSpinner', '~> 0.6'
pod 'Alamofire', '~> 1.1'
pod 'SuperRecord', '~> 1.2'
pod 'Toucan
When I did pod install I got the following error:
Pods written in Swift can only be integrated as frameworks; this feature is still in beta. Add use_frameworks! to your Podfile or target to opt into using it.
Updated:
Below is my console log:
$ pod install
Analyzing dependencies
Downloading dependencies
Installing Alamofire (1.1.4)
Installing SuperRecord (1.2)
Installing SwiftSpinner (0.6.0)
Installing SwiftyJSON (2.1.3)
Installing Toucan (0.2.0)
[!] Pods written in Swift can only be integrated as frameworks; this feature is still in beta. Add `use_frameworks!` to your Podfile or target to opt into using it.
Add "use_frameworks!" to your Podfile:
Please see below sample Podfile
target 'MySample' do
pod 'AFNetworking', '~> 2.5'
pod 'Net', '~> 0.2' #This is a sample in Swift
use_frameworks! # <--Use this line
end
Add "use_frameworks!" to your Podfile because:
Because Apple doesn't let you build static libraries that contain
Swift. Unlike Objective-C, Apple doesn't ship the Swift standard
runtime libraries with iOS. This decouples the language version from
the platform version. When you build an app with Swift, you're
responsible yourself to ship them. By default, Xcode uses
swift-stdlib-tool to handle copying the Swift runtime dylibs, but the
tooling falls short when attempting to ship frameworks that use Swift
with an app that is Objective-C only. Your app executable and the
frameworks you ship will all use the same set of dylibs, which are
embedded into the Frameworks subdirectory of the application bundle.
First, that's because you can't link against different versions of the
standard libraries. Furthermore it is desirable to embed them only
once and not multiple times, because of constraints to memory size and
network speed, which are relevant for distribution.
You can make CocoaPods integrate to your project via frameworks
instead of static libraries by specifying use_frameworks!. If that's
not present, you won't be able to integrate dependencies, if you
depend on a pod which includes Swift source code.
Reference: http://blog.cocoapods.org/CocoaPods-0.36/
as it written in Podfile it says uncomment use_frameworks! is your are using Swift so all you have to do uncomment this line and all works just fine
# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'YourProjectName' do
pod 'SwiftyJSON', '~> 2.1'
pod 'SwiftSpinner', '~> 0.6'
pod 'Alamofire', '~> 1.1'
pod 'SuperRecord', '~> 1.2'
pod 'Toucan'
# all other pods goes here
end
target 'YourProjectName' do
end
target 'YourProjectName' do
end
the solution is very simple. You only have to add these lines to your pod file:
target 'PassDTAFirebase' do
inherit! :complete
# Here your pods
use_frameworks!
end
I my case i used to upgrade cocoapods by command sudo gem install cocoapods and my issue got resolved. I used objective - c as well as swift libraries in my project.

Xcode 6 doesn´t find cocoapods libraries

I am trying to build a Xcode 5 project that uses CocoaPods. The POD file is following:
target "MyProjectName" do
pod 'AFNetworking', '2.2.1'
pod 'SVProgressHUD', '0.9'
pod 'MDHTMLLabel', :head
pod 'CCBottomRefreshControl'
pod 'EXPhotoViewer', '~> 1.1.2'
pod 'NHBalancedFlowLayout', '~> 0.2'
pod 'SevenSwitch', '~> 1.3.0'
pod 'REFormattedNumberField', '~> 1.1.5'
end
The cocoapods is installing and updating correctly.
The error is: Did not find the libraries, like the one highlighted in my .pch:
#import "SVProgressHud.h"
...
/Users/xyz/Documents/Projects/avbc/repo/ios/project/ProjectName-Prefix.pch:17:13: 'SVProgressHud.h' file not found
I already did the pod reinstalling steps from solution below, without success:
Cocoapods with Xcode 6 and 10.10 Yosemite
What should I do to build my project properly?
Try the following:
1) I usually set the platform on my pod file:
platform :ios, '7.0'
2) Have you linked the library with <>?:
#import <SVProgressHUD/SVProgressHUD.h>
3) It is HUD instead of Hud. (Uppercase) <- If you link to Hud the file will never be found
Perfom "Project Clean" (Cmd+Shift+K) to solve the problem.

Resources