How to fix error with CocoaPods? - cocoapods

I'm learning iOS just now.
I cloned from https://github.com/huyouare/SwiftParseChat.git
and I build it but get error.
diff: /../Podfile.lock: No such file or directory
diff: Manifest.lock: No such file or directory error:
The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.`
So I remove the workspace file and pod install.
rm -rf MyProject.xcworkspace
pod install
But I met errors.
Re-creating CocoaPods due to major version update.
Analyzing dependencies
[!] The dependency `Alamofire (~> 1.3)` is not used in any concrete target.
The dependency `APAddressBook` is not used in any concrete target.
The dependency `Bolts` is not used in any concrete target.
The dependency `JSQMessagesViewController (from `https://github.com/galambalazs/JSQMessagesViewController.git`, branch `smooth-scrolling`)` is not used in any concrete target.
The dependency `JSQSystemSoundPlayer` is not used in any concrete target.
The dependency `FBSDKCoreKit` is not used in any concrete target.
The dependency `FBSDKLoginKit` is not used in any concrete target.
The dependency `FBSDKShareKit` is not used in any concrete target.
The dependency `FBAudienceNetwork` is not used in any concrete target.
The dependency `Parse` is not used in any concrete target.
The dependency `ParseUI` is not used in any concrete target.
The dependency `ParseCrashReporting` is not used in any concrete target.
The dependency `ParseFacebookUtils` is not used in any concrete target.
[!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.
The Podfile is :
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, ‘8.0’
use_frameworks!
pod 'Alamofire', '~> 1.3’
pod 'APAddressBook'
pod 'Bolts'
pod 'JSQMessagesViewController', :git => 'https://github.com/galambalazs/JSQMessagesViewController.git', :branch => 'smooth-scrolling'
pod 'JSQSystemSoundPlayer'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'FBAudienceNetwork'
pod 'Parse'
pod 'ParseUI'
pod 'ParseCrashReporting'
pod 'ParseFacebookUtils'
How can I fix this error?

You can modify the podfile like this:
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'SwiftParseChat' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'Alamofire', '~> 1.3’
pod 'APAddressBook'
pod 'Bolts'
pod 'JSQMessagesViewController', :git => 'https://github.com/galambalazs/JSQMessagesViewController.git', :branch => 'smooth-scrolling'
pod 'JSQSystemSoundPlayer'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'FBAudienceNetwork'
pod 'Parse'
pod 'ParseUI'
pod 'ParseCrashReporting'
pod 'ParseFacebookUtils'
# Pods for SwiftParseChat
end

Try like this
rm Podfile
pod init
Then new Podfile is created.
Then you can insert necessary API to the new Podfile.

Related

Cocapods -Can't Update pod ObjectMapper to version 3.3 error [!] Unknown command: `ObjectMapper,`

I just updated to Xcode 10.1 Swift version 4.2.1 and I have several build errors of:
Invalid redeclaration of '<~'
I followed this GitHub q&A and this one that says I need to update the ObjectMapper pod to version 3.3
I didn't see the ObjectMapper inside the regular Podfile however I saw it inside the Podfile.Lock and the version is - ObjectMapper (2.2.9)
I then went to terminal and tried all of these to update to 3.3 but none of them worked:
$ pod repo update
$ pod update
$ pod update ObjectMapper
$ pod 'ObjectMapper', '~> 3.3'
$ pod 'ObjectMapper', '3.3'
In terminal I keep getting:
Why do I keep getting this error?
Here is the regular podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
target 'MyProject' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyProject
pod 'Stripe'
pod 'AFNetworking'
pod 'Alamofire'
pod 'SwiftyJSON'
pod 'SDWebImage'
pod 'Fabric'
pod 'Crashlytics'
pod 'KeychainSwift'
pod 'IQKeyboardManagerSwift'
pod 'DLRadioButton', '~> 1.4'
pod 'GoogleInterchangeUtilities'
pod 'GoogleNetworkingUtilities'
pod 'GoogleParsingUtilities'
pod 'GoogleSymbolUtilities'
pod 'GoogleUtilities'
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/DynamicLinks'
pod 'Firebase/Storage'
pod 'Firebase/Crash'
pod 'Firebase/Messaging'
pod 'FirebaseInstanceID', '3.2.0'
pod 'GeoFire', :git => 'https://github.com/firebase/geofire-objc.git'
pod 'GooglePlacesAPI'
pod ‘GoogleMaps’
pod 'GooglePlaces'
pod 'GooglePlacePicker'
pod 'ReachabilitySwift'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.2'
end
end
end
end
I had to remove all the pods from my project then reinstall them.
First run the below code because you have to install the cocoapods-clean plugin to run pod clean.
$ sudo gem install cocoapods-clean
Second I copied all the pods from my podfile and placed them in a temporary different file then I ran the below 3 commands to remove all the pods:
$ pod deintegrate
$ pod clean
$ rm Podfile
After it was clean using the above 3 commands I then ran pod init to create a new Podfile, opened it, and pasted the saved pods from the temporary file. I also added the below ObjectMapper pod to the Podfile:
$ pod 'ObjectMapper'
Then I ran pod install to install everything
After everything was done I ran $ vim Podfile.lock and the ObjectMapper now had a version of:
- ObjectMapper (3.4.1)

Google/CloudMessaging' and Firebase/Messaging' fail with erro duplicate symbol

I am using Firebase in my project as well as Google sing-in.
For that I am using pod library.
pod 'SVProgressHUD'
pod 'SDWebImage'
pod 'AlamofireObjectMapper', '~> 4.0'
pod 'Google/SignIn'
pod 'IQKeyboardManagerSwift'
pod 'FBSDKLoginKit'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'Firebase/Auth'
pod 'Google/CloudMessaging'
This are my pod which I am using in project.
Now I am remove pod 'Google/CloudMessaging' then app build successfully but GGLContext.sharedInstance().configureWithError(&configureError)
giving error like below
You have enabled the CloudMessaging service in Developer Console, but it appears as though your Podfile is missing the line: 'pod "Google/CloudMessaging" or you may need to run pod update in your project directory.
If I am adding pod "Google/CloudMessaging pod and then build project XCode fail with duplicate symbols.
How can I add two and also avoid this error.
It seems you cant use GCM and FCM at the same time as FCM is the new improved GCM and you're certainly going to run into those kind of errors. You can see that question addressed in this SO post

Unable to find a specification for `Alamofire (~> 3.5)`

target 'MyApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'Alamofire', '~> 3.5' end
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'MyAppUITests' do
inherit! :search_paths
# Pods for testing
end
This is the pod file, swift 2.3, Xcode VERSION 7.3.1. I'm trying to install alamofire , but I'm getting the error above, i searched google , but there wasn't any useful things to do. any help?
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
target 'MyProject' do
use_frameworks!
# Pods for MyProject
pod 'Alamofire', '~> 4.7'
end
Hopefully this must work. Check for your Pod version also.
First of all try make higher deployment target
if not work then
Try to run these command one by one
pod repo remove master
pod setup
pod update

Unable to find a specification for '[Any pod libraries]'

I don't know what's wrong with my cocoapods. It always show this error on every pod libraries every time I run pod install. For instance "AFNetworking"
[!] Unable to find a specification for `AFNetworking (~> 3.0)`
I tried the following but nothing help:
pod repo update
sudo rm -fr ~/.cocoapods/repos/master
pod setup
pod install
I tried to update my cocoapods to 1.1.1, Xcode to 8.2 and Mac OS to 10.12.2 but problem remain.
My cocoapods can't even search. It show this error every time I run "pod search AFNetworking"
[!] Unable to find a pod with name, author, summary, or description matching `AFNetworking`
Here is my podfile look like:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'Leader' do
use_frameworks!
pod 'AFNetworking', '~> 3.0'
end
I did try to uninstall and reinstall cocoapods back but nothing help.
Please follow below format in your pod file its working in project.
#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 'applicationName' do
pod 'AFNetworking', '~> 3.0'
end
If you find any issue please let me know.

Swift cocoapod install framework (Alamofire) occur Syntax error in xcode

I have some problem in installing some external framework. Therefore, I try it in a blank project but the error are the same and I am not sure where i did wrong.error image
It is a little uncommon. It seems like I did install a wrong version of framework as in it appear 40+ error in code syntax.
Also, the error are from Alamofire,AmazonS3RequestManager and so on.
It is my podfile and I just put pod install in the target file directory
source 'https://github.com/CocoaPods/Specs.git'
# 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 'test' do
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'AlamofireImage', '~> 2.0'
pod 'Firebase', '>= 2.4.3'
pod 'SwiftValidator', '3.0.1'
pod 'AmazonS3RequestManager', '~> 0.8'
pod 'MBProgressHUD', '~> 0.9.2'
end
The code in your screenshot is for Swift 2.2, so you have to update Xcode to the latest version, Xcode 7.3. Your version is too old.

Resources