Can't install pod in iOS app with Firebase - ios

I am not able to successfully install pods to my project. I am always getting this error:
This is my Podfile (I added FirebaseFirestoreSwift but even when I undo the changes, its still not working):
It was working fine a month ago.

You need to install the latest version of Xcode command line tools using xcode-select --install. If you already have an installed version, you might get an error similar to
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
In that case, try removing the old command line tools from /Library/Developer/CommandLineTools and reinstall it again.

Related

React Native Invalid Podfile file: [!] Unable to locate the executable node

I'm using Macbook pro-2020 apple M1 Chip, I have created a new ReactNative project and it runs fine on the simulator but if i have to install any other plugins, and have to install pods. it gives me errors like this.
i have installed all the requirements app running fine but once it comes pod installs it fails each and every time. any help would be much appericiated.
I believe this has been answered in how-to-running-cocoapods-on-apple-silicon-m1
I recommend following the updated answer for 2022. If you haven't already, use Homebrew, even tho it's not recommended by the maintainers. M1 with ARM architecture is amazing but many libraries are still not compatible and need to be run in x86 mode.
I would uninstall everything, including and gems you used originally, and run the following Homebrew commands and link them all....
brew install node
brew install yarn
brew install cocoapods
Reinstalling those should now work when you run pod install inside your ios file. This is what worked for me. Hope this helps.
I was facing the same error, this is what worked for me:
I first reinstalled the node, yarn, CocoaPods, after that I run the following commands:
brew link cocoapods
If still gives you error, remove old linked pod using following command:
rm '/opt/homebrew/bin/pod'
Now run this command again:
brew link cocoapods
Once the above command works successfully, then move to your project's iOS folder and run the following command:
pod install

How to install older version on carthage

I need to have carthage for running Appium tests.
While Appium community is still working on supporting XCode9.2, we need to rely on XCode 8.3.3
OS: MacOS High Sierria
XCode version: XCode 8.3.3
Java: 1.9
But when I run command brew install carthage, I am getting below error:
Error: Your Xcode (8.3.3) is too outdated.
Please refer below link, which implies that- XCode9 support for Appium is not yet rolled-out
[https://github.com/facebook/WebDriverAgent/issues/639][1]
Kindly suggest work around in meanwhile.
Thanks
1) First of all be sure to remove everything:
brew uninstall --force carthage
2) Then search the commit that you like from here:
https://github.com/Homebrew/homebrew-core/search?p=2&q=carthage&type=Commits&utf8=✓
3) in your case might be this:
https://github.com/Homebrew/homebrew-core/commit/f74d9ba598c9843552450abeb382cacd0e71d4c0
the one related to Carthage v0.24, which should be compatible with your requirement of working with Xcode 8.3.3.
4) then get the commit identifier f74d9ba598c9843552450abeb382cacd0e71d4c0 and run:
brew install https://github.com/Homebrew/homebrew-core/raw/f74d9ba598c9843552450abeb382cacd0e71d4c0/Formula/carthage.rb
I was having the same problem, but was unable to use brew install. I kept getting a 404 error when trying to do it.
To get an old version I cloned the Carthage project from the repo, changed my working copy to the specified version tag I needed and ran make install. This worked :D

Google Firebase build error for iOS from Unity

I recently tried to setup Google Firebase Analytics for my Unity game. I am building it for iOS exclusively. I have not been able to get Firebase working unfortunately.
I am using Xcode 8.1, OSX 10.12.1, and Unity 5.5.0f3
Whenever I try to build to iOS from Unity, I get this error in console:
Error running cocoapods. Please ensure you have at least version 1.0.0. You can install cocoapods with the Ruby gem package manager:
sudo gem install -n /usr/local/bin cocoapods
pod setup
'pod --version' returned status: 127
output:
UnityEngine.Debug:LogError(Object)
Google.IOSResolver:Log(String, Boolean, LogLevel)
Google.IOSResolver:OnPostProcessInstallPods(BuildTarget, String)
UnityEditor.HostView:OnGUI()
I have tried just about every suggestion I could find online. I have installed Cocoapods version 1.1.1, and later I tried the beta version 1.2.0.beta.1, nothing has worked.
Typing "which pod" in my terminal yields: /usr/local/bin/pod
Typing "pod --version" in my terminal yields the correct version number (i.e.: 1.2.0.beta.1)
I cannot get this build to work in my game's project, or a completely empty project to which I just imported firebase and tried to build.
I also tried to get this working with the sample project at the following link with no success: https://github.com/firebase/quickstart-unity
I am out of ideas here... can anyone help?
Much appreciated!
Firebase engineer here.
The code reporting the error is here:
https://github.com/googlesamples/unity-jar-resolver/blob/b7a90e43d6c893622102ca53681f53a58dab1a24/source/IOSResolver/src/IOSResolver.cs#L760
unfortunately, it looks like we're not logging the stderr stream so it's tricky to see how this is failing.
It sounds like your pod tool is returning a non-zero error code, not sure why. For example, on my machine I see the following:
$ which pod
/usr/local/bin/pod
$ pod --version ; echo $?
1.1.1
0
As you can see "pod --version" is returning "0" (success).
Similarly, pulling the latest Cocoapods tool from github https://github.com/CocoaPods/CocoaPods yields:
cd CocoaPods
export RUBYLIB=$(cd lib ; pwd)
export COCOAPODS_NO_BUNDLER=1
$ ./bin/pod --version ; echo $?
1.2.0.beta.1
0
Where the same thing is happening, the pod tool is returning a success exit code.
Things to try:
Contact support#firebase.google.com - we'll be able to work directly with you to diagnose and resolve this issue.
Try changing your LANG variable, we've been tripped up by this code https://github.com/CocoaPods/CocoaPods/blob/8db5956/bin/pod#L3 in the past. It's supposed to be handled by https://github.com/googlesamples/unity-jar-resolver/blob/b7a90e4/source/IOSResolver/src/IOSResolver.cs#L743 but you never know.
If you feel brave, build https://github.com/googlesamples/unity-jar-resolver/ yourself (you should be able to run ./gradlew in the root directory to build the DLLs) then you can add the stderr reporting, post / diagnose the error you're running into.
Cheers,
Stewart
If you have this error in your output:
Failed to extract git version from `git --version` ("xcrun: error: active developer path (\"/Applications/Xcode.app/Contents/Developer\") does not exist\nUse `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.\nSee `man xcode-select` for more details.\n") (RuntimeError),
...and IF you have a different path to XCode (like in my case, I had Xcode beta), then you should run the command:
sudo xcode-select --switch /Applications/Xcode-beta.app/

CocoaPods - [!] The `xcproj` tool has failed to touch the project

I get the following error when I'm trying to update my pods:
[!] The xcproj tool has failed to touch the project. Check whether
your installation of xcproj is functional.
xcproj --project "/xxxxx/Pods/Pods.xcodeproj" touch
DVTFoundation.framework not found. It probably means that you have
deleted, moved or renamed the Xcode copy that compiled xcproj.
Simply recompiling xcproj should fix this problem.
I rebuildet everything and reinstalled CocoaPods and nothing helped.
Does anyone have any suggestions what else I could try?
This is because you have xcproj installed, probably via homebrew, and it breaks when you update versions of Xcode. Like the error message states, you need to reinstall it. You should be able to do this with:
brew reinstall xcproj

Manual Install of Xcode command line tools not working

I've manually installed the Xcode command line tools from the Apple website, and I went through the install process but it doesn't seem to be working. I ran this from the terminal to see if it installed:
Zach-Boyette-MacBook-Pro-2:~ zachboyette$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 5.1.0.0.1.1396320587
volume: /
location: /
install-time: 1398301024
groups: com.apple.FindSystemFiles.pkg-group com.apple.DevToolsBoth.pkg-group com.apple.DevToolsNonRelocatableShared.pkg-group
So it looks like the command line tools have installed, but when I run this:
Zach-Boyette-MacBook-Pro-2:~ zachboyette$ xcode-select --install
A popup says: The "xcode-select" command requires the command line developer tools. Would you like to install the tools now?
I clicked install and then it said: Can't install the software because it is not currently available from the Software Update server.
I've read on other answers that the solution is to do a manual install, but I just did that so I don't understand why it's not working. Also, in Xcode downloads, it's not showing the Command Line Tools.
I've tried installing it manually many times so I don't know why it's not working.
Installing Jekyll still won't work:
Zach-Boyette-MacBook-Pro-2:~ zachboyette$ sudo gem install jekyll
Password:
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
EDIT: echo $PATH returns this:
Zach-Boyette-MacBook-Pro-2:~ zachboyette$ echo $PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/zachboyette/.rvm/bin
Command Line Tools are not included in XCode 5.1.1
You have to install it manually, BUT DON'T USE "xcode-select --install". It does not work.
Open Xcode app.
Click on Xcode > Open Developer Tools > More Developers Tools.
That will take you to Downloads for Apple Developers web site.
Use your AppStore Id to login.
Download Command Line Tools for your Mac OS X version.
I have stumbled across this issue before when I completely hosed my development environment by deleting an ancient Xcode version.
Have you tried running sudo xcode-select -r to clean up? This sorted my problem.
From the man page:
-r, --reset
Unsets any user-specified developer directory, so that the
developer directory will be found via the default search mecha-
nism. This command must be run with superuser permissions (see
sudo(8)), and will affect all users on the system.
The easiest work around is to install the XCode app from the App Store then open XCode and agree to the Terms and Conditions.
From there the Command Line Developer Tools package can be installed on using xcode-select --install or by trying to use any command line developer tool in Terminal like git.

Resources