I have a Podfile in the project, but No `Podfile' found in the project directory - xcode

recently I bought new macbook 16(intel, catalina)
I have started new project, I cannot install pods in my xcode project.
I successfully installed cocoapods and pod init.
but I cannot run command pod install.
This is what I get when I type command
ruby -rrbconfig -e 'puts RbConfig::CONFIG["rubyhdrdir"]'
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0
Please help if you have similar experience or good guess.
Thank you.

I had the same message about no 'Podfile'. I've solved this by moving my project to different directory with simple path. The previous one was too complicated - with backspaces, foreign language characters, with special characters.I think, the installer didn't like something about that.

Related

Trouble with pod install of hermes engine on m1 mac

I've created a React-Native application as of 0.70.6, went through the grief of cocoapods and everything that comes with development on Apple's silicon chips (M2) and got it working and have done quite a bit of work on the project, and then (after creating a GitHub repo) handed it off to a coworker to do some design work (who is on an M1) ...had many issues on their machine as well, but eventually got it working. Now, React-Native 0.71.0 has been released and I ran through all of the steps to upgrade it and got it working on my M2 machine, no issues at all, but after pushing and getting it on their machine, I have not been able to find a solution to the pod install failing due to the hermes-engine not being able to load, a couple of the errors that pop up are,
[!] Failed to load 'hermes-engine' podspec:
[!] Invalid `hermes-engine.podspec` file: undefined method 'exists?' for FileClass.
I have been searching all day for what this means (I am fairly new to React-Native ...and mobile development in general) and I've gathered that 'exists?' has been deprecated as of certain versions of ruby (I'm on 3.2.0) although, it runs fine on my machine, so I am confused as to what could be missing. I've been using chruby to install ruby, and the only difference there is that I have ruby versions 2.7.5 and 2.7.7 on my machine ... but of course, there are flags that I had to set in order to actually be able to install them on my machine and I don't believe they affect my project since bundle install and pod install works using 3.2.0.
To list out what all I have installed on these machines:
bundler -> 2.4.1
cocoapods -> 1.11.3
ruby -> 3.2.0
node -> 18.13.0
xcode -> 14.2 (with command line tools)
Another bit of error reporting, in case it is useful:
Command `pod install` failed.
└─ Cause: Failed to load 'hermes-engine' podspec:
[!] Invalid `hermes-engine.podspec` file: undefined method `exists?' for File:Class.
# from /Users/<user>/projects/<app_dir>/node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec:46
# -------------------------------------------
# source[:http] = "file://#{destination_path}"
> elsif File.exists?(hermestag_file) && isInCI
# Pod::UI.puts '[Hermes] Detected that you are on a React Native release branch, building Hermes from source but fetched from tag...'.yellow if Object.const_defined?("Pod::UI")
# -------------------------------------------
If there is any information that I need to include for clarity, I will update this post as need-be.
I've tried removing the Pods file, and then pod install... same error
Removed Podfile.lock, cache clean AND removing Pods... same error
Removing node_modules/ npm cache clean --force && npm install
then doing npx pod-install to hopefully let node handle things... same error
Ran pod deintegrate and pod install... was scary, broke things, so reverted, back to square 1
There are other things that I've tried earlier today that I cannot remember, and they've gone home, so I can't access all the commands I ran, but these were the freshest, and until I get a more clear view, I'll be trying to get those flags that need to be set to install the older versions of ruby to see if that does anything
One last mention though, we also recently got an M1 Mac Mini, and I ran through all of the steps to get the project working...ended up in the same rut as the other M1, but again, will be trying those LD_FLAGS or whatever it may be and update this thread if that is what fixes the issue
Looking at older issues related to these, people found work-arounds using -x86_64 commands, and I've managed to get this far without any since maintainers have released newer versions with arm64 support, but if I need it anywhere, so be it, I'll take what I can get at this point
Without needing to install other versions of ruby or anything, I got it install the hermes-engine pod by doing something I find dirty...which is just go into that file it mentions and remove the 's' in exists? so it just says exist? and then I also downgraded cocoapods from 1.11.3 to 1.11.2 and seeing how that .podspec file is laid out, it conditionally loads the engine by first seeing if is downloaded on the machine, and then once it sees that it is not, that's where it eventually hits this problem code with the exists conditional...so it downloaded everything and worked fine and I was able to build and run my app on the mac mini...but when trying the same steps on the other m1 machine, I got a very useful error -- Oh no, an error occured ...perfect, and now I am questioning if these changes I have made will effect the M2 pod commands
If there is no better answer provided in the next few days, I'll assume this is the best possible fix until react-native upgrades their ruby version to 3.2.0 which after some more digging...is the exact release that this exists? file method was removed
But would still love feedback for anyone else using an M1 MacBook who has had these issues on the stable release of React-Native 0.71.0

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

I'm stuck with CocoaPods

I'm seriously stuck with CocoaPods. Please help!
Can someone please tell me where i'm going wrong? I'm doing an online Objective-C course. I've been stuck on CocoaPods for far too long. I completed the CocoaPods course and seem to have installed everything correctly.
I have followed these steps in line with this tutorial:
1) I created a podfile within the PhotoBombers Xcode project.
2) Within Xcode I clicked on the podfile, then entered: pod 'SimpleAuth/Instagram'
3) I then searched for the Terminal using Spotlight. Within the terminal I then entered 'pod' and pressed enter (as shown in the tutorial), however the following code appeared and looked nothing like the code in the tutorial:
Usage:
$ pod COMMAND
CocoaPods, the Cocoa library package manager.
Commands:
cache Manipulate the CocoaPods cache
init Generate a Podfile for the current directory.
install Install project dependencies to Podfile.lock versions
ipc Inter-process communication
lib Develop pods
list List pods
outdated Show outdated project dependencies
plugins Show available CocoaPods plugins
repo Manage spec-repositories
search Search for pods.
setup Setup the CocoaPods environment
spec Manage pod specs
trunk Interact with the CocoaPods API (e.g. publishing new specs)
try Try a Pod!
update Update outdated project dependencies and create new
Podfile.lock
Options:
--silent Show nothing
--version Show the version of the tool
--verbose Show more debugging information
--no-ansi Show output without ANSI codes
--help Show help banner of specified command

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"

Implementing ObjCMongoDB into a project

I am having trouble implementing the "Getting Started" portion of using the ObjCMongoDB driver for MongoDB. Please simplify some of the instructions. I am new to Github and some of the terms do not quite click for me. Any sort of simplification or a step by step process of doing this would be helpful.
CocoaPods is a command line tool for managing Objective-C dependencies. If you're having trouble following the ObjCMongoDB Getting Started guide (or will be building a number of projects) CocoaPods should be an easier install process. As an added bonus, there are thousands of other dependencies that can be installed via CocoaPods once you're set up.
With the exception of creating your XCode project, the following steps need to be done from a command-line prompt (i.e. Terminal or iTerm).
First, install CocoaPods
$ gem install cocoapods
(You may need to sudo gem install cocoapods if you are using a default Ruby install)
Setup the CocoaPods master repo, which includes definitions of Objective C dependencies that can be installed:
$ pod setup
Create a new Xcode project (or use an existing one)
Create a new iOS or OS X project in Xcode. If you have an existing project, you can skip to the next step.
Change to the project directory
$ cd ~/src/myproject
Create a new Podfile
You can run pod init and then edit the default Podfile created, but for simplicity this will work:
$ echo "pod 'ObjCMongoDB', '~> 0.11.0'" >> Podfile
Run pod install
$ pod install
Analyzing dependencies
Downloading dependencies
Installing ObjCMongoDB (0.11.0)
Installing mongo-c-driver (0.8.1)
Generating Pods project
Integrating client project
[!] From now on use `MyProject.xcworkspace`.
Open the workspace file in XCode
$ open MyProject.xcworkspace
#import "ObjCMongoDB.h" and get started coding your app
You should now be set to start coding with The Basics of using ObjCMongoDB.

Resources