ios github undeclared identifier AFHTTPRequestOperation - ios

I have created a repo of my project in Github, i used AFNetworking cocoapod in my project. When i download my project from github and tried to run in xcode, it raises errors like 'undeclared identifier AFHTTPRequestOperation'
Could anyone please help me in resolving this issues.

It seems that you have not pushed your pod projects to the repo.
Go to you project/pod directory and run the command
pod install
For future remove pod from the .gitignore file if any.
If the problem still persist then edit you pod file and add
pod 'AFNetworking', '~> 2.5
then run the same command
pod install

Related

I have deleted a Pod from Pods Library but still it's showing this error and not running

I have deleted RoundCornerProgress Pods from Pods library in Xcode but after that when I run the project it shows this error. How can I resolve this problem?
Try using pod install --no-repo-update command.
Remove the pod that you don't need from your pod file and then run this command.
This command will essentially remove the unwanted libraries without affecting other dependencies. Clean and build your project after doing this and it should work fine.
Use pod deintegrate to remove all traces of CocoaPods from the Xcode project.

Unable to find a specification for 'SquareInAppPaymentsSDK' in Objective-C Pod file

I want to add SquareInAppPaymentsSDK in project and project is written in Objective-C. When I try to add pod 'SquareInAppPaymentsSDK' in my pod file and try to run pod install at that time I am getting this specification error.
Square has mentioned to add this line but I am not using Swift for development then what can I do it in Objective-C.
use_frameworks!
pod "SquareInAppPaymentsSDK"
Please let me know if anyone have any idea about this. Do I have to use manual installation?
Try using this command -
$ pod repo update
in your terminal. It will sync the latest podspec files for you. Then try -
$ pod install

Pod Install throwing error in terminal for Xcode project

I am trying to install cocoa pods into my project, so followed installation of pod file setup. So, latest pods installed to my system.
When I tried to install pod file to my project throwing following error.
But, pod file create with blank.
I have given following command and getting following error :
MacBook-Pro:Videos username$ pod install
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client projects
[!] Could not automatically select an Xcode workspace. Specify one in your Podfile like so:
workspace 'path/to/Workspace.xcworkspace'
And I tried Pod init also, if I try to open pod file, its showing empty pod file. And not even showing Target which is default pod file setup.
Anyone suggest me, how to fix this.
This is the general approach while installing pod. Make sure you follow these and it should work fine (I am assuming cocoa pods are installed on your system) So your issue lies in one of the following steps:
Go to the project root directory - cd root_directory_path
pod init
Open pod file and add required pods (See library installation guide. Each has one)
pod install
Empty pod does not get created usually. But even if it does, you can just copy the format of pod file contents into your file and install the pod.
As to your empty pod file, reinstall cocoa pods on your system. Also make sure pod is uninstalled from project/workspace you are working on. There might be a faulty installation earlier.

Cannot Install Cocoapods - No podfile found in the project directory

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

An unexpected version directory while using pod repo lint

I can't fix problem with cocoapods. I'm trying to create private repo with some library. When I'm executing
pod repo lint MyLib --verbose
I'm getting error:
An unexpected version directory AppIcon.appiconset was encountered
for the MyLib/Images.xcassets Pod in the Images.xcassets
repository.
I dig google for solutions for it, but only hints was to update cocaPods. At this moment I've newest version but still no clue how to move forward.
Any ideas what to check?
You lost the extension.
pod repo lint MyLib.podspec

Resources