Installation error in Cocoapods - ios

I am trying to install cocoapods for my project. And i followed these steps
But its showing 0 dependencies in podfile. Can anyone tell me what should i do??? And also guide me how to install Google API for my project in order to show list of places in a tableview.
UPDATED QUESTION
I have also tried the following steps but still it is not working-
Seriously am going crazy right now.Unable to find the mistake. And idea where am i going wrong???

1.Edit the Podfile and add the following lines.
source 'https://github.com/CocoaPods/Specs.git'
pod 'GoogleMaps'
2.Save the Podfile.
3.and then locate your project path and use command
pod install
follow the link for reference
https://developers.google.com/maps/documentation/ios-sdk/start

if you are opened the any Xcode Project you must close all Xcode project that is already open and then try the Pod Install command , surely works
Update
after this command pod init Type this command to open the Podfile using Xcode for editing:
open -a Xcode Podfile
then you need to add the pod 'GoogleMaps' or whatever you need , see the attached image for reference
for step to integration see this

Related

The Podfile does not contain any dependencies [duplicate]

I'm doing the Ray Wenderlich tutorial called SimpleWeather.
The podfile is in the same folder as the project.
Here's my code from the podfile:
platform :ios, '7.0'
xcodeproj 'SimpleWeather'
pod 'Mantle'
pod 'LBBlurredImage'
pod 'TSMessages'
pod 'ReactiveCocoa'
The error message is this: [!] Unable to find the Xcode project /Users/myName/Developer/SimpleWeather.xcodeproj for the target Pods.
The name of the project is SimpleWeather.
I'm pretty sure you are not in the right directory. Are you sure your .xcodeproj is in the Developer folder? There might be a subfolder you need to navigate to.
The right way to enable CocoaPods in your Project is:
Open Terminal and execute: $ sudo gem install cocoapods
Navigate to your Project folder (I assume in your case it's cd /Users/myName/Developer/SimpleWeather/SimpleWeather.xcodeproj).
Setup Cocoapod pod setup
Create the Podfile touch Podfile
Open the Podfile open -e Podfile and insert your code for Podfile
Finally install the Podfile pod install
If you follow this instructions everything should work. When opening your project make sure to open the .xworkspacefile.
For more information, see this.
This error also occurs when you have multiple .xcodeproj in your Xcode project.
You don't need more than one .xcodeproj in general cases. Remove unnecessary .xcodeproj, and Cocoapods should get the correct path automatically afterwards.
Reiterating our original conversation:
Accordingly to Podfile Syntax Reference the Podfile looks right.
Make sure you are running $pod install from your project directory:
/Users/myName/Developer/SimpleWeather
Hey your path for the project might be wrong. Go to the project and right click on SimpleWeather.xcodeproj and select Get Info as show in the image below(The right side window is for Get Info here). Copy this path from the details window and paste it into the Podfile. After that append /SimpleWeather.xcodeproj to that pasted path. This might solve the problem(Note: It is a snap shot for my project). In your case the solution might be replacing the path with this /Users/myName/Developer/SimpleWeather/SimpleWeather.xcodeproj
To solve this issue, just follow below steps and your issue will get resolved :
Step 1 : Open Terminal and navigate to your project folder
Step 2 : touch podfile
Step 3 : open -e Podfile
Step 4 : Write below line in your text edit and close it
workspace '/Users/systemName/Developer/yourprojectname/yourprojectname.xcworkspace'
Step 5 : Pod install
And after successful process, you will not get this error again.
CheersKP
Maybe you have two project .xcodeproj, remove one.
Remove Podfile.lock, folder Pods. On Terminal cd /Users/myName/Developer/SimpleWeather and pod install
For people who are on Mac and also using code editors, the duplicate file that is causing this issue is ._projectname.xcodeproj because it has the same extension as the regular .xcodeproj files.
I had the same problem.
Then with many attempts of trials and errors I finally got the working solution:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target 'SimpleWeather'
pod 'Alamofire', '~> 3.4'
This works when you are in your project directory (I assume you should navigate using terminal to /Users/myName/Developer/SimpleWeather/)
You installed your Xcode..in application use this command to execute
sudo xcode-select -switch /Applications/Xcode.app
so okay i had tried every possible thing ...i had only one .xcodeproj file
but sill i couldnt install so finally i had tried with the following
1. open terminal cd to your project folder one with .xcodeproj
2. type pod init
3. type touch Podfile
4. type pod install
Magic happens and your pod files gets installed
Check your Podfile for the following lines
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
under
target '<project_name>' do
Hopefully this answer can be useful in times of many people using SPM. My case was the following: I had a binary framework package that had to be converted to the cocoapod, together with it's dependency tree. In the git repository where the package lived, the .gitignore file contained this line: /*.xcodeproj. This meant that even though everything worked fine locally, whenever the CI tried to run pod install it failed.

Using CocoaPods for the "Charts" framework. Swift 2

I am a newbie when it comes to CocoaPods so please bear with me!
I am looking at the tutorial (https://www.raywenderlich.com/97014/use-cocoapods-with-swift) however this is using the dependency "pod 'Alamofire', '2.0.2'". I have looked online for over a hour now and I can't find what to use for the Charts framework (https://cocoapods.org/?q=charts).
So Far i have done the following steps:
1.
sudo gem install cocoapods
and got the following output:
2.
pod setup --verbose
and got the following output:
3.
open -a Xcode Podfile
and got the following result :
4.
Uncommented "use_frameworks!" and uncommented "platform :ios, '6.0'" and changed it to "platform :ios, '9.0'"
Now i am stuck as i don't know what dependancies i need to use for the charts framework. Apologies if this is a very simple answer!
Thanks in advanced for your help :)
EDIT: After installing the pod files i dragged the 'Charts.xcodeproj file into my project.
When i try and embed binaries i have various options:
When i add them and build i get the following errors:
Hey First you have to decide which chart library You want to use.
Something like this https://github.com/danielgindi/ios-charts
for above chart library you have to use
pod 'Charts'
in your pod file inside the project .
Now your pod file will be something like this
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Charts'
Now open the terminal and go to your project directory and enter the command
pod install
and you are good to go.
Hope this help you.
Usually there are instructions on what CocoaPod name to use for installation on the GitHub or source code hosting page of the library.
After a pod install command under your correct project directory, you need to exit out of your .xcodeproject and open up the workspace file. This is what you do from now on after a project has a cocoapod dependency. The workspace now contains both your project, and the pods project as a package manager. The pod(s) you installed are there, and must be accessed by importing the name of the CocoaPod (can be seen in folder drop down view in the Pods project).
You do not need to drag anymore files in your own project or embed like before. Make sure to delete those.
If you're still having trouble, can you edit what your current podfile looks like?

Issues with use_frameworks in Podfile

I'm currently having an issue with integrating a specific cocoapod and was wondering if I could get some help/insight. I'm trying to integrate the JSQMessages pod, found here: https://github.com/jessesquires/JSQMessagesViewController.
When I add the pod to my Podfile and run pod install, I'm not able to import the project like I need to. It doesn't recognize it. I found out that this is because I need the use_frameworks! line in my Podfile. However, when I add that line, my project breaks because I use Google Maps and Braintree APIs through cocoapods as well, and those break with the use_frameworks line. I've encountered this problem in the past with other pods, but was able to fix them with manual import. This one doesn't seem as straightforward. I have a couple questions
Looking at the pod, is it possible to do a manual import for JSQMessages pod?
Is there a way also to use_frameworks for some pods and not for others, because that could solve it as well?
Any other solutions to my issue would be a big help as well! Please let me know as soon as possible!
I added both the
pod 'GoogleMaps'
pod 'Braintree'
to my won project that has pod 'JSQMessagesViewController' installed and it build fine. So this is what I think your problem may be.
The root of your issue is not with the use_frameworks! line in your podfile
The problem is that you are using your PROJECTNAME.xcodeproj but with pods when you run the pod install command this creates a new PROJECTNAME.xcworkspace
Close your Project and open the new PROJECTNAME.workspace that was created after you run pod install in your projects root directory in terminal.
Let me know if you have more questions 👻

Cannot install third party library

I keep trying to add https://github.com/jessesquires/JSQMessagesViewController into my project but it keeps coming up with a linking error.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I don't know what I am doing wrong I can't seem to add the demo into a blank project and get it to work.
This is what I'm doing:
I download the zipfile which contains the demo project folder (not an entire xcode project, just the .h and .m files needed for the demo).
I open a blank xcode project and insert the demo project folder.
I delete the blank project's plist, storyboard, main and app delegate files.
From the terminal, I cd into the project and make a podfile that looks like this:
platform :ios, '7.0'
pod 'JSQMessagesViewController'
pod 'JSQSystemSoundPlayer'
I run pod install.
I open the project in its new workspace that has the pods and I try to run it.
It throws the linking error.
What step am I missing? I see on the GitHub installation process it says:
#import <JSQMessagesViewController/JSQMessages.h> // import all the things
but I don't know what that means. I figured it meant something about updating your headers seach path but when I look at that under Build Settings its already pointing to the header file in the pods.
Is there an obvious step I'm missing when adding a third party library?
I installed JSQMessagesViewController through cocoapods in my project, I did not get any errors successfully installed.Please try the following steps:
Open Terminal and navigate to the directory containing your project by using the cd command:
cd ~/Path/To/Folder/Containing/Project
Next enter this command: pod init
Type this command to open Podfile using Xcode for editing:open -a Xcode Podfile.
Copy and paste this line: pod 'JSQMessagesViewController', '6.1.3' and save it.
Type this command: pod install
This installs dependent libraries related to JSQMessagesViewController and JSQSystemSoundPlayer.
After this close the project and go to your project folder ,use the workspace intead of xcodespace : yourProject.xcworkspace. Hope this post might help you.
1.Open a brand new project from Xcode, do not delete anything.
2.cd ~/ROOT_PATH_OF_YOUR_PROJECT
3.Edit your Podfile if your already had one
Podfile
platform :ios, '7.0'
pod 'JSQMessagesViewController'
pod 'JSQSystemSoundPlayer'
4.run pod install
5.open yourproject.xcworkspace
6.Build

How do I select a project in my Podfile? I'm getting the error: Unable to find the Xcode project for the target 'Pods'

I'm doing the Ray Wenderlich tutorial called SimpleWeather.
The podfile is in the same folder as the project.
Here's my code from the podfile:
platform :ios, '7.0'
xcodeproj 'SimpleWeather'
pod 'Mantle'
pod 'LBBlurredImage'
pod 'TSMessages'
pod 'ReactiveCocoa'
The error message is this: [!] Unable to find the Xcode project /Users/myName/Developer/SimpleWeather.xcodeproj for the target Pods.
The name of the project is SimpleWeather.
I'm pretty sure you are not in the right directory. Are you sure your .xcodeproj is in the Developer folder? There might be a subfolder you need to navigate to.
The right way to enable CocoaPods in your Project is:
Open Terminal and execute: $ sudo gem install cocoapods
Navigate to your Project folder (I assume in your case it's cd /Users/myName/Developer/SimpleWeather/SimpleWeather.xcodeproj).
Setup Cocoapod pod setup
Create the Podfile touch Podfile
Open the Podfile open -e Podfile and insert your code for Podfile
Finally install the Podfile pod install
If you follow this instructions everything should work. When opening your project make sure to open the .xworkspacefile.
For more information, see this.
This error also occurs when you have multiple .xcodeproj in your Xcode project.
You don't need more than one .xcodeproj in general cases. Remove unnecessary .xcodeproj, and Cocoapods should get the correct path automatically afterwards.
Reiterating our original conversation:
Accordingly to Podfile Syntax Reference the Podfile looks right.
Make sure you are running $pod install from your project directory:
/Users/myName/Developer/SimpleWeather
Hey your path for the project might be wrong. Go to the project and right click on SimpleWeather.xcodeproj and select Get Info as show in the image below(The right side window is for Get Info here). Copy this path from the details window and paste it into the Podfile. After that append /SimpleWeather.xcodeproj to that pasted path. This might solve the problem(Note: It is a snap shot for my project). In your case the solution might be replacing the path with this /Users/myName/Developer/SimpleWeather/SimpleWeather.xcodeproj
To solve this issue, just follow below steps and your issue will get resolved :
Step 1 : Open Terminal and navigate to your project folder
Step 2 : touch podfile
Step 3 : open -e Podfile
Step 4 : Write below line in your text edit and close it
workspace '/Users/systemName/Developer/yourprojectname/yourprojectname.xcworkspace'
Step 5 : Pod install
And after successful process, you will not get this error again.
CheersKP
Maybe you have two project .xcodeproj, remove one.
Remove Podfile.lock, folder Pods. On Terminal cd /Users/myName/Developer/SimpleWeather and pod install
For people who are on Mac and also using code editors, the duplicate file that is causing this issue is ._projectname.xcodeproj because it has the same extension as the regular .xcodeproj files.
I had the same problem.
Then with many attempts of trials and errors I finally got the working solution:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target 'SimpleWeather'
pod 'Alamofire', '~> 3.4'
This works when you are in your project directory (I assume you should navigate using terminal to /Users/myName/Developer/SimpleWeather/)
You installed your Xcode..in application use this command to execute
sudo xcode-select -switch /Applications/Xcode.app
so okay i had tried every possible thing ...i had only one .xcodeproj file
but sill i couldnt install so finally i had tried with the following
1. open terminal cd to your project folder one with .xcodeproj
2. type pod init
3. type touch Podfile
4. type pod install
Magic happens and your pod files gets installed
Check your Podfile for the following lines
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
under
target '<project_name>' do
Hopefully this answer can be useful in times of many people using SPM. My case was the following: I had a binary framework package that had to be converted to the cocoapod, together with it's dependency tree. In the git repository where the package lived, the .gitignore file contained this line: /*.xcodeproj. This meant that even though everything worked fine locally, whenever the CI tried to run pod install it failed.

Resources