I found these tutorials to create our own cocoapod:
https://guides.cocoapods.org/making/making-a-cocoapod.html
http://code.tutsplus.com/tutorials/creating-your-first-cocoapod--cms-24332
but for me none of them helps, as they create fresh xcode project using pod lib create. I have my own xcode project and I need to setup in that rather than create a fresh one.
1.Delete following files/folder that pod created.
2.Make sure your Podfile available.
3.Use this command:
pod install
Updated
If you didn't have installed pod in your project. Do like following:
1.Use pod setup in your project root folder.
2.Edit Podfile
3.Use this command:
pod install
Try to do like this:
1.Run the command on Terminal:- sudo gem install cocoapods
After successfully install CocoaPods
2.Go to that folder where your existing project is saved in your System.
3.After that Run the command for creating Pod file:- Touch podfile
4.After Creating Pod file run the next command:- Open podfile
It will open pod file and here Put the below line and save that file using command+S
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, ‘8.0’
use_frameworks!
pod 'Alamofire', '~> 2.0.2’
5.After that run the final command in your Terminal:- pod install
It will take some time to install that file after that once install the all file close the xcode project and again open that project, click on the .xcworkspace extension file.
Related
I am using macincloud to do some xcode work and I have a xcode package that works fine on the computer it was made on, but in macincloud I get a no module error. How do I check on my pod library, is it part of the of the computer or is part of my code?
I have read about opening up terminal and typing in different commands to install pods but nothing is working
Here is what is in my Podfile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'WallpaperBoard' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'IQKeyboardManagerSwift'
pod 'Google-Mobile-Ads-SDK'
pod 'DBImageColorPicker'
pod 'SSUIViewMiniMe'
# Pods for WallpaperBoard
end
Cocoapods is a dependency manager. Running the pod install command on Terminal, it downloads all the Pods as external dependencies and creates a .xcworkspace for your project.
It needs to be run once in every different computer you run your project.
On Mac In Cloud:
Open Terminal
Navigate to the project folder, where the Podfile is. Usually you can navigate with the cd command. Example:
cd /Users/user_name/Desktop/project_folder
Run the command to install the Pods:
pod install
Open the generated .xcworkspace file
I am trying to use Alamofire for my Swift project. The following is the podfile:
platform :ios, '9.0'
target 'CocoaExample' do
use_frameworks!
pod 'Alamofire', '~> 4.4'
end
I have spent around 5-6 hrs searching for solutions and tried but no luck.
Please let me know how to resolve the issue to install Alamofire ~4.4.
Follow the below steps to install Pods.
As I have just done it in sample project and it works for me :
Before we proceed make sure that you have pods installed on your computer.
With your project directory Open the terminal and hit below command
pod init
This will create Podfile in same directory.
Open Podfile and add target :
pod 'Alamofire', '~> 4.4'
fire commmand 'pod install'
This will install pod and it create pod workspace in your project.
close your xcode and go in the same directory. there will be file call yourprojectname.xcworspace . Open this file then you are all set to go.
I have installed cocoa pods and added many libraries like the AFNetworking but nothing is getting invoked. I have set the Linked Frameworks and Libraries 'Status' as optional but getting nil reference for all the libraries. What am I doing wrong?
Steps to install Pods on your Xcode project
Open Terminal add this command or write cd and drag and drop folder direct to terminal
cd ~/Path/To/Folder/Containing/ShowTracker
pod init
Open PodFile from your Xcode project and add your framework
or you can direct open Xcode pod file using this command: open -a Xcode Podfile
Add frameworks
pod 'AFNetworking', '2.2.1'
pod 'IQKeyboardManager'
pod 'Facebook-iOS-SDK'
At last close window of Xcode Podfile and got o terminal and write this command
pod install
Hope this helps you..
I downloaded a sample project to learn how to make a UIPageViewController, and I am trying to essentially fork that project and need to add a third-party library. Right now, it does not look like I have a .xcworkspace file in my project. When I try and install the cocoapods, I first run
sudo gem install cocoapods - in the specific project directory in my terminal
pod install - in that same directory
I am receiving an error in the terminal "No podfile found in the project directory."
Is this happening because I don't have a .xcworkspace file? Am I installing the podfile correctly?
Steps to add CocoaPods to manage dependencies in your project:
sudo gem install cocoapods -> This installs CocoaPods as a piece
of software on your machine.
Go to the root of your project directory and execute pod init ->
This will add a base Podfile to your project.
Add the external dependencies that you have to this Podfile by editing it.
Run pod install which will fetch all the external dependencies
mentioned by you, and associate it with a .xcworkspace file of
your project. This .xcworkspace file will be generated for you if
you already do not have one.
From here on, you should use .xcworkspace file instead of .xcproject / .xcodeproj.
Example Podfile Syntax:
target 'MyApp' do
pod 'AFNetworking', '~> 3.0'
end
Where AFNetworking is the pod and 3.0 is the specific version that I want to install.
Documentation: Using CocoaPods
Just posting for anyone that encountered this issue while working on a react native project.
sudo gem install cocoapods
this installs cocoa pods to your machine
cd projectDirectory cd into your project directory
cd ios cd into the ios directory of your project, is you list items that are in this folder, you would most likely see a podfile there.
pod install
If you want to add a library from GitHub to your own project, after installing gems, do firstly pod init look at from GitHub cocoapod description and then add it after target line in podfile.
Save and run "pod install".
It would be successfully added on your project.
Don't forget to call pod install in the Project folder of your project (not in the root).
Open a terminal, if you use VSCode, you can just run the following from the terminal
Do a cd <project_name> to your flutter project directory
Run cd iOS
Then run pod install
I have one complete project. which I downloaded from site.
https://medium.com/learning-xcode-as-a-designer/animate-in-xcode-without-code-20c82a904164
It gave me a project.
I also download a DEMO project which has only added Pods Files, looks below
After that I made a DemoAnimation project. and made its Pod using pod init, but it made Pod of that project like below
Now, my confusion is that how to make Pod of canvas project and use into my project. as if I use by dragging and dropping, it doesn't work.
How to make Pod file or existing project and embed into my own project and use it?
If you're already on CocoaPods,
1.enter to your project root directory.
2.Create a file call Podfile and add the content
platform :ios, '7.0'
pod 'Canvas', '~> 0.1'
Or open terminal: (cd to your root directory)
$ cd {ROOT_DIR}
$ edit Podfile
platform :ios, '7.0'
pod 'Canvas', '~> 0.1'
3.Run pod install to install the dependencies.
4.Then you should now have the Xcode workspace (.xcworkspace) ready.
5.Go on with the terminal or just open the xcworkspace file.
$ open -a xcode App.xcworkspace
That's it.