How to modify an existing podfile for the latest Xcode version? - ios

Is there a way to format this pod file for the latest version of Xcode? Build errors with Afnetworking occur only after adding the below code to an existing application's pod file and running the pod install command from the terminal.
platform :ios, '9.0'
target 'PushChatStarter' do
use_frameworks!
pod 'AFNetworking', '~> 1.2.0'
pod 'MBProgressHUD', '~> 0.6'
pod 'MessageBanner', '~> 1.0'
pod 'Alamofire', '~> 4.5'
pod 'AlamofireImage', '~> 3.3'
pod 'Stripe'
pod 'Cards'
end
This is the original pod file of the application when everything with Afnetworking works.
platform :ios, '6.0'
pod 'AFNetworking', '~> 1.2.0'
pod 'MBProgressHUD', '~> 0.6'
platform :ios, '7.0'
pod 'MessageBanner', '~> 1.0'
Afnetworking is operating before the new gems are installed correctly. What is causing Afnetworking to fail at runtime after the pod file update ?

Related

Cant import dependency in xcworkplace cocoapods

i am relatively new in ios, especially cocoa pods. i ran into a problem,somehow the IgListKit dependency is un-importable, I already clean build, build 1st then add the import, even deleting the xcworkplace and adding a new one by doing pod install
How do I fix it? is it an issue within the Pod? should I file an error? Thank you
How I add the dependencies :
# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'
target 'LearnViper' do
pod 'Alamofire', '~> 5.4'
pod 'RxSwift', '6.2.0'
pod 'RxCocoa', '6.2.0'
pod 'Kingfisher', '~> 7.0'
pod 'SkeletonView'
pod 'IGListKit', '~> 4.0.0'
end
platform :ios, '12.0'
target 'LearnViper' do
use_frameworks!
pod 'Alamofire', '~> 5.4'
pod 'RxSwift', '6.2.0'
pod 'RxCocoa', '6.2.0'
pod 'Kingfisher', '~> 7.0'
pod 'SkeletonView'
pod 'IGListKit', '~> 4.0.0'
end
you have to update your gem file with command first
sudo gem install -n /usr/local/bin cocoapods
then after that open podfile add pods and install
Looks like all you have to do is add
use_frameworks! in your pod file

Error with cocoapods link_with after update to 1.0.0

I have updated cocoapods today to 1.0.0 version. I got this string when I update the pods:
[!] Invalid Podfile file: [!] The specification of link_with in the Podfile is now unsupported, please use target blocks instead..
I have removed link_with in my podFile but I can't build the project because I have many Match-O-Linkers. Any one knows how should I fix this problem?
This is my Podfile right now:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
inhibit_all_warnings!
pod 'pop', '~> 1.0'
pod 'AFNetworking', '~> 1.3'
pod 'SDWebImage', '~> 3.7'
pod 'GoogleAnalytics', '~> 3'
pod 'ARAnalytics' , :subspecs => ["Crashlytics", "Amplitude", "DSL"]
pod 'FBSDKCoreKit', '~> 4.10.1'
pod 'FBSDKLoginKit', '~> 4.10.1'
pod 'FBSDKShareKit', '~> 4.10.1'
pod 'Google/SignIn'
pod 'Branch'
pod 'Leanplum-iOS-SDK'
pod 'Fabric', '1.6.7'
pod 'Crashlytics', '3.7.0'
pod 'TwitterKit'
pod 'Digits'
target 'minubeTests' do
pod 'OCMockito'
end
Try this. Works for me with more than one target.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
def myPods
pod 'pop', '~> 1.0'
pod 'AFNetworking', '~> 1.3'
pod 'SDWebImage', '~> 3.7'
pod 'GoogleAnalytics', '~> 3'
pod 'ARAnalytics' , :subspecs => ["Crashlytics", "Amplitude", "DSL"]
pod 'FBSDKCoreKit', '~> 4.10.1'
pod 'FBSDKLoginKit', '~> 4.10.1'
pod 'FBSDKShareKit', '~> 4.10.1'
pod 'Google/SignIn'
pod 'Branch'
pod 'Leanplum-iOS-SDK'
pod 'Fabric', '1.6.7'
pod 'Crashlytics', '3.7.0'
pod 'TwitterKit'
pod 'Digits'
end
target 'yourTargetOne' do
myPods
end
target 'yourTargetTwo' do
myPods
end
target 'minubeTests' do
pod 'OCMockito'
end
According to the new official CocoaPods specification since version 1.0 the new model is this:
Note that BasePods is not the actual name of any target in the project.
TargetNameOne and TargetNameTwo are the real names.
platform :ios, '8.1'
inhibit_all_warnings!
abstract_target 'BasePods' do
## Networking
pod 'AFNetworking', '~> 2.6'
# Twitter
pod 'TwitterKit', '~> 1.9'
pod 'Fabric'
# Specify your actual targets
target 'TargetNameOne'
target 'TargetNameTwo'
end
Edit - There is an implicit abstract target at the root of the Podfile now, so you could write the above example as:
platform :ios, '8.1'
inhibit_all_warnings!
## Networking
pod 'AFNetworking', '~> 2.6'
# Twitter
pod 'TwitterKit', '~> 1.9'
pod 'Fabric'
# Specify your actual targets
target 'TargetNameOne'
target 'TargetNameTwo'
This is for multiple targets which is the most common case, but can be used for single target as well and I like one universal pattern.
With the new specification. all your pod include should be specified target based.
Change your pod file to
platform :ios, '8.0'
# change minube to whatever name is of you main target
target 'minube' do
pod 'pop', '~> 1.0'
pod 'AFNetworking', '~> 1.3'
pod 'SDWebImage', '~> 3.7'
pod 'GoogleAnalytics', '~> 3'
pod 'ARAnalytics' , :subspecs => ["Crashlytics", "Amplitude", "DSL"]
pod 'FBSDKCoreKit', '~> 4.10.1'
pod 'FBSDKLoginKit', '~> 4.10.1'
pod 'FBSDKShareKit', '~> 4.10.1'
pod 'Google/SignIn'
pod 'Branch'
pod 'Leanplum-iOS-SDK'
pod 'Fabric', '1.6.7'
pod 'Crashlytics', '3.7.0'
pod 'TwitterKit'
pod 'Digits'
end
target 'minubeTests' do
pod 'OCMockito'
end

Swift Eureka error inside library after installation

I just did install Eurika library from xmartslab
I already googled this problem, unfortunally found nothing
As usual added it to my Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target 'Project' do
pod 'Alamofire', '~> 3.0'
pod 'SDWebImage', '~>3.7'
pod 'ObjectMapper', '~> 1.1'
pod 'Eureka', '~> 1.5'
pod 'SDWebImage', '~>3.7'
end
After installation I got a bunch of errors:
What can cause this problem. Could it be any incompatibility with other libraries?
I suppose you are using Xcode 7.2 or older. You will have to upgrade to Xcode 7.3 or change your Podfile to pod 'Eureka', '~> 1.4.1'

Frameworks on Cocoapods using old iOS version

When I run pod install Cocoapods Frameworks are referring to iOS 8.3 I can't find the way to change them to iOS 9
--Screenshots
http://1drv.ms/1iTSswC
I'm currently using Xcode 7. My Podfile:
platform :ios, '9.0'
#source 'https://github.com/CocoaPods/Specs.git'
# ignore all warnings from all pods
inhibit_all_warnings!
xcodeproj 'Conversa'
link_with 'Conversa', 'ConversaTests'
pod 'AFNetworking', '~> 2.5'
pod 'JSQMessagesViewController', '~> 7.2.0'
pod 'JSQSystemSoundPlayer', '~> 2.0'
pod 'CocoaLumberjack'
pod 'Fabric'
pod 'Crashlytics'
#pod 'UIActionSheet+Blocks'
pod 'UIAlertView-Blocks'
pod 'YapDatabase/SQLCipher'
pod 'JVFloatLabeledTextField'
pod 'CRToast', '~> 0.0.7'
#pod 'Mantle', '~> 1.4'
#pod 'Navajo', '~> 0.0'
pod 'Appirater'
pod 'SIAlertView'
pod 'GCDWebServer', '~> 3.0'

Building errors after updating CocoaPods libraries

I'm working on a legacy iOS project as a newbie. After I updated the CocoaPods and libraries, I've got these weird errors after building the project which never happen before.
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lPods-Model
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lPods-Model is not an object file (not allowed in a library)
And here is my Podfile:
platform :ios, '7.0'
link_with ['DianaViewModels']
pod 'AVOSCloud', '~> 3.0'
pod 'PixateFreestyle'
target :Model do
link_with ['DianaModels']
pod 'ReactiveCocoa', '~> 2.2'
pod 'TMCache', '~> 1.2'
pod 'SSKeychain', '~> 1.2'
pod 'Mantle', '~> 1.3'
pod 'AFNetworking', '~> 1.0'
end
target :Test do
link_with ['DianaTests']
pod 'Kiwi', '~> 2.2'
end
target :View do
link_with ['Diana']
pod 'SVPullToRefresh', '~> 0.4'
pod 'MBProgressHUD', '~> 0.7'
pod 'SWTableViewCell', '~> 0.1'
pod 'MTMigration'
pod 'Masonry'
pod 'TTTAttributedLabel'
pod 'NJKWebViewProgress'
target :ViewDebug do
link_with [
'DianaDev',
'DianaViews'
]
pod 'Reveal-iOS-SDK'
end
end
By the way, I'm using the CocoaPods plugin in the Xcode. But a lot error are output when I check the Install Docs during integration:
Error opening xar archive: /var/folders/3x/mgl299js6k13tlrspqv21n340000gn/T/Model-ReactiveCocoa.xar
Are there some wrong configurations in my CocoaPods or Build Setting in Xcode6.3? Thanks for your help!
ADDED:
Here's my Link Binary With Libraries in the Build Phases. Does the red item mean something is wrong? It looks like this is the cause.

Resources