Cannot run pod command to add OpenSSL - xcode

I am running on a Mac with OSX 10.8.x (Mountain Lion). I have inherited an XCode project (XCode 5) that I need to update with OpenSSL. This project is actually a workspace that uses cocoapods. I thought it would be easy to add OpenSSL as a new pod, so I found this:https://github.com/krzak/OpenSSL which says to type this command:
pod 'OpenSSL', :podspec => 'https://raw.github.com/krzak/OpenSSL/master/OpenSSL.podspec'
So, I went to terminal and did a CD into the root folder of the project, where the xcworkspace file is located. There I see a main folder for my project (call it MyProject) and another folder called Pods. I looked inside the Pods folder and I see a bunch of folders for various Pods (RESTKit, SOCKkit, etc). Each of these folders has its own podspec file. Anyway, I make sure I am CD-ed into the Pods folder, and then I run the command above. I get this response in terminal:
-bash: https://raw.github.com/krzak/OpenSSL/master/OpenSSL.podspec: No such file or directory
When I run 'which pod' I get /usr/bin/pod so I know that the pod command is installed. And I also know that the OpenSSL.podspec file does indeed exist at that URL. So what do I need to do to make this work?

Its changed. Use following:
Installation
pod 'OpenSSL-Universal'
Or always latest version
pod 'OpenSSL-Universal', :git => 'https://github.com/krzyzanowskim/OpenSSL.git', :branch => :master
Source Link: https://cocoapods.org/pods/OpenSSL-Universal

Related

Where is the Cocoa Pods Podfile kept?

I need to add to a Cocoa Pods Podfile to install SwiftLint, but install docs and forums 'gloss' over the detail of where it's located.
Open terminal and in the root of your project directory run...
pod init
That will create the pod file and all the other parts of the project that are needed.
If you can’t do that... the pod file lives in the root directory of your project.

Swift - Unable to open file in target Xcode 10

I am trying to run Aplication which I have downloaded from GitHub.
When I run get error unable to open file in target, I have Xcode 10.
I already searched for solution and get this one.
I had the same problem, but in Xcode 6.1.1 - what fixed it for me was to change the configuration file setting to None for the two Pods-related targets, then run pod install again.
The configuration file setting is found by selecting the project (not the target) and then the Info tab.
But cant find configuration file location.
Here is the error picture:
https://i.stack.imgur.com/Ql3M5.png
In File -> Project setting -> select Legacy Build System
Make sure you have opened .xcworkspace file and pod installed properly.
A solution I found to work for me was
Inside the project root directory
root
|- <ProjectName>
|- <ProjectName>.xcodeproj
|- <ProjectName>.xcworkspace
|- <ProjectName>Tests
|- Podfile
|- Podfile.lock
|- Pods
Delete the following files. Ensure you have copied the contents of Podfile.
Podfile
Podfile.lock
Pods Folder
Open your .xcodeproj using Xcode or using terminal command
open <ProjectName>.xcodeproj
Inside Xcode, locate the "Pods" folder which should contain something along the lines of...
Pods
|- Pods-<ProjectName>.debug.xconfig
|- Pods-<ProjectName>.release.xconfig
Delete those references and select "move to trash" when prompted.
Close Xcode
Now run the following:
pod init && pod install
Open your Podfile and paste in your previously copied old Podfile that was deleted earlier.
run the following command:
pod install
In terminal open Xcode again with the following command
open <ProjectName>.xcworkspace
Note: that I opened the xcworkspace file NOT the xcodeproj file.
At this point for me I was able to compile my code as normal without having to change back to the Legacy Build System.
Reinstall the pods to get everything cleaned up:
pod deintegrate
pod cache clean --all
pod install
This happened due to change the Project Name or Miss the Pods from Your Project
if the Pods are Miss Then Following Method
open the Project and Command + Shift + K
Close the Project
Open Terminal got to Your Xcode Project Directory cd /your-Xcode-project
if coca pods are already installed so skip this Point if not sudo gem install cocoa pods run this Command on terminal
pod install
If Above Method not Working so its Project name Issue then Go with following Method
First, open your Pod File and change the target
target 'your Xcode project name' do
run the Following Commands from Terminal
go to Your directory from terminal
pod deintegrate
pod clean
pod install
Done now open your xcWorkSpace file
For me it works, update the version of CocoaPods and reinstall the pods
sudo gem install cocoapods
Run following commands after you have downloaded Xcode project from GitHub:
cd /your-xcode-project
pod install
This worked on Xcode 10.2.
I had this issue too with project I cloned from GitLab. Your error looks extremely similar to mine. I solved it by running this in Terminal:
cd path/to/your/project
pod install
When I checked project folder in Finder, there was a Podfile. But same project viewed in Xcode had nothing under 'Pods' module. From this I figured out the pods are not installed (or installed properly?) and installing them solved this error.
If there is some Pods or .xcworkspace file, it might be worth doing pod deintegrate before installation - just to be sure :)
I was facing the same error opening an old project in a new macbook with a recent installation of Xcode and no cocoa pods or anything related on it.
My way to fix this was following some of the steps en the issues #1727 of alamofire and change some things. Open the terminal and cd project where the pod file is.
So, this is what worked for me:
sudo gem install cocoa pods
pod repo remove master
pod setup
pod repo update
pod install
Then just, clean build folder and build the project.
Quit Xcode
Open Terminal
Change to directory (where podfile is present)
pod install
I was trying to do pod install after removing unwanted pod(steps 2,3 & 4), but it still was not working. Quitting Xcode (steps 1, 2, 3 & 5) worked.
If you suddenly start seeing this issue on an existing project, before you try anything else, try
pod update
Make sure your pod build settings looks good
Clean build folder
Retry building
1-
in xcode
menu --> project --> clean build files
2-
close project
3-
in terminal
cd
4-
in terminal
pod update
5-
re-open
project..xcworkspace file
6-
clean, build
good luck
delete file name "Podfile.lock" and try pod install again.
Just stumbled into the issue recently myself. It seems it's a bug in CocoaPods.
Possible fix: gem install cocoapods --pre
I tried below and error went away !!
project name - SwiftExample
Went to Pods -> Info -> Configurations -> Debug
Change to None for Pods-SwiftExample
Code compiles even after setting it back to original.
I can see many solutions already given there. But I believe the easiest way to resolve this problem is
Open the project directory in Terminal
Delete .xcworkspace file
Run pod install
That's it. The newly created .xcworkspace file will work without any problem.
Open your project file (project.pbxproj) and check of 'Pods' is added to the path before the 'Target Support Files' folder. Remove that and i got it to build fine.

Creating a pod with cocoapods fails

I've just tried to create a pod using pod lib create Test and went with all the defaults. However, when it is done asking me questions I get:
Running pod install on your new library.
[!] No `Podfile' found in the project directory.
Ace! you're ready to go!
We will start you off by opening your project in Xcode
open 'Test/Example/Test'
The file /Users/macattack/Documents/Xcode/Test/Example/Test.xcworkspace does not exist.
I don't understand what I've done wrong.
I'm using XCode 8, cocoapods 1.1.0.rc.2.
Following is working on Cocoapods 1.1.0.rc.2 version.
You haven't done anything wrong. It's a pre-release version, just a few more steps required.
Podfile is already there, but in the Example folder. Open terminal, proceed to Example folder:
cd [path]
You can just drag&drop the folder after 'cd' letters to paste the path.
Then just run pod install.
Open workspace, Xcode will prompt you to update to last Swift syntax version and update version property.
If you are using Swift 3 there is another option, suggested by authors (Issue 5841).
Create a .swift-version file in pod parent folder. Run echo "3.0" >> .swift-version
Create pod with pod lib create [pod name].
Proceed to pod Example folder and run pod install
Hope it helps!
Artem

Issues with adding a pod file to my Xcode project

I've been trying to create a pod file for my project in my directory using the terminal, but I'm running into the issue shown below, any suggestions?
I tried restarting my Mac and even tried to add one to a different project but to no avail. Also couldn't seem to find any other instances of this occurring.
Here's the terminal output:
Matts-Mac-mini:~ sarabytestudios$ cd /Users/sarabytestudios/Desktop/Blurr\Messenger/Blurr\ Messenger.xcodeproj
Matts-Mac-mini:Blurr Messenger.xcodeproj sarabytestudios$ pod init
[!] No xcode project found, please specify one
Matts-Mac-mini:Blurr Messenger.xcodeproj sarabytestudios$
You have to create your PodFile in the same directory as your Blurr Messenger.xcodeproj.
In your case should be in /Users/sarabytestudios/Desktop/Blurr\Messenger/.
In that directory, create a file called PodFile where you must declare the cocoapods you want to include in your project (you can do it by hand or call pod init). The you must type pod install.
After that, you must open the new generated file called Blurr Messenger.xcworkspace.
1) Run 'pod init' command inside the project directory(directory containing YourProject.xcodeproj file)(This will create a Podfile, a YourProject.xcworkspace file, Podfile.lock file and a Pods folder)
2) Run 'pod install' command inside the same directory.
3)Open your project using YourProject.xcworkspace file and NOT the YourProject.xcodeproj file(otherwise build fails).

Incorrect path for Pods.debug.xcconfig in Xcode?

so I used Venmo/Synx on my Xcode project with CocoaPods, and it completely screwed everything up.
I was able to fix the Manifest.lock and Podfile.lock errors, but now I am getting this error:
The file “Pods.debug.xcconfig” couldn’t be opened because there is no such file. (/Users/user/GitHub/xxxxxx/Pods/Pods/Target Support Files/Pods/Pods.debug.xcconfig)
As you can see, the path is incorrect, as there is no Pods/Pods directory (there is one extra pod).
How can I fix this? I have only added PODS_ROOT to the user-defined variable, as that fixed my Podfile and Manifest.lock files.
Any help would be much appreciated!
Edit:
After adding PODS_ROOT, I get this when running pod install.
[!] The `Project [Debug]` target overrides the `PODS_ROOT` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
I had the same problem in Xcode 6.1.1. I did the following to solve it:
Set the configuration file setting* "None" for the Pods related target.
Close the .xcworkspace.
run pod install again
now open and build your .xcworkspace
*The configuration file setting is found by selecting the project (not the target) and then the Info tab.
If your path to pods in error is wrong try this:
use pod deintegrate
delete all pod remains files - Podfile.lock, Pods, <Project>.xcworkspace
open <Project>.xcodeproj
remove Pods project on left side
try pod install
I had the same problem with Xcode 11 but I just updated CocoaPods and it worked.
Update CocoaPods to latest version with sudo gem install cocoapods
Run pod install again
I had the same error while trying to build my project for the first time. This is how I resolved it:
pod deintegrate
sudo gem install cocoapods-clean
pod clean
Open the project and delete the “Pods” folder that should be red.
pod setup
pod install
Reopen and build the project, I think it's good to go!
I faced this issue when I upgraded/downgraded cocoapods between 1.6.x and 1.5.x.
The following step fixed this error
1, go to project info tab
2, just under Deployment target, there is configurations field. change your configuration. In my case, there are 2 options
/Users/user/GitHub/xxxxxx/Pods/Pods/Target Support Files/Pods/Pods.debug.xcconfig
/Users/user/GitHub/xxxxxx/Pods/Target Support Files/Pods/Pods.debug.xcconfig
3, clean and build again.
1- Remove your Pods folder Podfile.lock and xcworkspace files root in your project.
2- Open .xcodeproj
3- Go to Build Settings and under Build Options search Always Embed Swift Standard Libraries
4- Update its value with $(inherited)
5- Close project and pod install again
There has been an update to cocoa pods that is causing this problem. Please refer to the cocoa pods release notes :
Change shell script relative paths to use ${PODS_ROOT} instead of ${SRCROOT}/Pods.
Whirlwind #7878
This was done in version 1.6.0.beta.1 (2018-08-16)
Release notes are here: cocoapods release notes
I had the same error and I fixed in following way
1 - Goto your projected setting by blue icon of your project from left pan
2 - Select your project under the project
3 - Select Info window
4 - Check IOS deployement target. This target should be same as you set in general settings of your project (Pic 2).
I got the same situation in Xcode 10.1. This is what works for me.
Open <Project>.xcworkspace
Go into your <project_name> folder(by default it's blue), delete the Pods folder (by default it's yellow)
In Terminal.app, run pod install again
Then I'm able to CMD + R to run the simulator
A few things worth trying:
As Keith mentioned above, you definitely want to exclude Pods from synx.
You almost certainly do not want to override the PODS_ROOT build setting.
I've seen similar errors to yours in a project with multiple targets. Make sure that your Podfile includes a link_with setting that specifies all your app targets.
If you have at least one test target, consider using your Podfile to explicitly import all your app pods to both your application and test targets.
I've not too much experience using a custom xcconfig with CocoaPods, but you might first try removing your xcconfig and allowing CocoaPods to generate its own first.
Close project
Do pod deintegrate
Delete - Podfile.lock, Pods,.xcworkspace in project directory
Do sudo gem install cocoapods
Do pod install
Go to project directory right click on
project.xcodeproj -> show package contents -> open project.pbxproj
Find
"Pods/Target Support Files/
and replace with
"Target Support Files/
This solution will work at any cost!
Try deleting the debug.xcconfig file and run pod install again. It solved my issue
In my case, I deleted my Podfile, Podfile.lock.
Run pod init, then copy all pods to new Podfile, then run pod install again and it's worked.
I think it's happened for the differences from folder paths in the old project (for me, I cloned another project from Git repo).
For me, changing Build system to Legacy in File -> workspace settings did the trick
For me, this caused after I updated cocoapods. So, I downgraded and the build worked again.
To downgrade, first list of all your versions:
sudo gem list cocoapods
Then specify the you want to delete (for me was 1.8.4):
sudo gem uninstall cocoapods -v 1.8.4
Then, with 1.5.3 worked!
This is what worked for me !
I use always Bundler to manage ruby dependencies, then in all my iOS projects i have Gemfile that look like this !
source "https://rubygems.org"
gem "cocoapods"
gem "fastlane"
gem "jazzy"
gem 'xcodeproj', :git => 'https://github.com/CocoaPods/Xcodeproj.git'
gem 'fastlane-plugin-teams', :git => "https://github.com/mbogh/fastlane-plugin-teams"
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
i just run the following, i advice you using alias for this :
## Alias to add in zshrc or bashrc
# bundle install
bdli() {
bundle install $#;
}
piu() {
kill $(ps aux | grep 'Xcode' | awk '{print $2}');
pod deintegrate;
pod repo update;
pod install;
pod update;
open -a Xcode *.xcworkspace;
}
then simply run :
bdli && piu
It will do everything for you :)
PS : To install Bundler go here -> Bundler
pod reintegrate
pod install
edit the .xcodeproj/project.pbxproj file and change the PBXGroup "path = Pods" to "name = Pods"

Resources