macOS 11.0.1 - Flutter doctor gives cocopods error - xcode

I was stuck with cocoapods problem while trying to install Flutter on my computer. Although I was constantly installing it, it was not seen by the flutter doctor. How can I solve this problem?
blackx#Black-Air ~ % sudo flutter doctor
Password:
Woah! You appear to be trying to run flutter as root.
We strongly recommend running the flutter tool without superuser privileges.
/
📎
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.5, on macOS 11.0.1 20B29 darwin-x64, locale tr-TR)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[!] Xcode - develop for iOS and macOS (Xcode 12.3)
✗ CocoaPods installed but not working.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
This can usually be fixed by re-installing CocoaPods. For more info, see https://github.com/flutter/flutter/issues/14293.
To re-install CocoaPods, run:
sudo gem install cocoapods
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.52.1)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.

Had the same problem.
I just looked up my .bash_history and tried to remember, so I don't know if all below is relevant or in the right order or complete. So here are more or less random commands which might help you.
In the flutter/ios folder
rm Podfile.lock
pod repo update
Elsewhere
sudo chown $(whoami) /usr/local/Homebrew
sudo brew cleanup -d -v
gem pristine ffi --version 1.14.2
curl -L https://get.rvm.io | bash -s stable
rvm install ruby
xcode-select --install
sudo brew tap --repair
brew install cocoapods
brew link cocoapods
git -C /user/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
If you do find out how to actually do it, please remember the order of your commands so you can post them here too :)

Related

Flutter cocoapods version conflict (Installed But Not Working)

so simply i am trying to archive my flutter project using Xcode to push it through apple store connect review process, i faced a problem that declare that the cocoapods version is old .. i am using cocoapods through cocoapods app not the gem ..
i simply uninstalled the app cause it's the lastest version of the app (Not of cocoapods) and then uninstalled any cocoapods related previous gems so that cocoapods is totally uninstalled on my machine (M1 Macbook Air) & installed the cocoapods gem using sudo gem install cocoapods .. on flutter doctor -v in my device ~ it shows me that cocoapods is installed but now working
[!] Xcode - develop for iOS and macOS (Xcode 14.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14C18 ✗ CocoaPods installed but not working. You appear to have CocoaPods installed but it is not working. This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it. This can usually be fixed by re-installing CocoaPods. To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
and the weird thing that when i try to re-install cocoapods first i run
gem list --local | grep cocoapods
then i uninstall everything that shows up using sudo gem uninstall command after that when i try flutter doctor -v it still shows me that it's installed but not working, But how when I uninstalled the application and the gems and everything related
Take in mind that when i run pod related command after the gem and application uninstallation it shows me this [!] Unable to locate the CocoaPods.app application bundle. Please ensure the application is available and launch it at least once. zsh: illegal hardware instruction pod.. any Ideas Or Solutions?

Flutter - 'Xcode installation is incomplete', Missing CocoaPods installation

I run flutter doctor on my Mac with Xcode 13.0 but it prompted that 'CocoaPods didn't install'.
So, I tried gem install cocoapods or sudo gem install cocoapods but it gives me Permission Error.
I also tried HomeBrew, brew install cocoapods but no luck as I run into Brew Link Error.
When I ran flutter doctor again, it gives Xcode installation is incomplete; a full installation is necessary for iOS development. Then, I deleted Xcode and CocoaPods to fresh start the installation. But it was not working.
I uninstalled HomeBrew and command line tools but it was unsuccessful.
Also, there are issues about flutter and android studio, and here is the flutter doctor output:
And here is my Android Studio project structure:
as the terminal suggests you, launch the following commands:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch

Can't deploy heroku on Mac OS M1

I'm new on Heroku and trying to deploy my project here. After I typed this command in the terminal: curl https://cli-assets.heroku.com/install.sh | sh
and I also typed the administrative password correctly , I got this error message: unsupported arch: arm64
The script does not support arm64 (see line 40 pf the script).
The easier option is to install via brew
brew tap heroku/brew && brew install heroku
or download the tarball for macOS (if you still prefer doing it manually)
Download the tarball macOS
tar xvf heroku-darwin-x64.tar
sudo mv heroku /usr/local/lib
cd /usr/local/bin
ln -s /usr/local/lib/heroku/bin/heroku .
heroku --help
Apple Silicon Issues
If you’re getting the following error on a machine with an Apple M1 chip, you haven’t installed or declined to install Rosetta 2.
Bad CPU type in executable
Installing Rosetta 2 resolves this issue.
If you don’t want to install Rosetta 2 on your machine, you can install the Heroku npm package globally and use your own Node binary locally. Only v16 of Node has M1 ARM support and npm isn’t the recommended install method.
ref: heroku install
brew tap heroku/brew && brew install heroku
This command doesn't work for me
==> Installing heroku from heroku/brew
Error: Your Xcode (14.0.1) is too outdated.
Please update to Xcode 14.1 (or delete it).
Xcode can be updated from the App Store.
but there is no update in theApp Store.
Try
arch -arm64 brew install heroic
Try
arch -arm64 brew install heroku

flutter doctor not finding cocoa pods

I have an issue that tells me to install cocoapods using gem, but the flutter doctor couldn't find it.
[✓] Flutter (Channel stable, 1.22.4, on macOS 11.0 20A2411 darwin-arm, locale en-IN)
• Flutter version 1.22.4 at /Users/kirandhoundiyal/flutter
• Framework revision 1aafb3a8b9 (3 weeks ago), 2020-11-13 09:59:28 -0800
• Engine revision 2c956a31c0
• Dart version 2.10.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Volumes/apps/Android/sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Volumes/apps/Android/sdk
• ANDROID_SDK_ROOT = /Volumes/apps/Android/sdk
• Java binary at: /Volumes/apps/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✗] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS
development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
✗ CocoaPods installed but not working.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with is
different from the one being used to invoke it.
This can usually be fixed by re-installing CocoaPods. For more info, see
https://github.com/flutter/flutter/issues/14293.
To re-install CocoaPods, run:
sudo gem install cocoapods
[!] Android Studio (version 4.1)
• Android Studio at /Volumes/apps/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6915495)
[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
Also gem list pod is giving an empty list but sudo gem list pod is giving this
*** LOCAL GEMS ***
cocoapods (1.10.0)
cocoapods-core (1.10.0)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.4.0)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-trunk (1.5.0)
cocoapods-try (1.2.0)
I am first time doing this stuff, need some help, what's wrong?
EDIT: ruby -v gives this ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
which ruby gives this - /usr/bin/ruby
First try this ;
sudo gem uninstall cocoapods
sudo gem install cocoapods
If it does not works for you.
Try this :(It works for me in macos Bigsur M1)
Check permission for the mentioned directory via:
ls -l /home/raphael/flutter/
If not, while being in the folder mentioned above, try to change permission on the folder via:
chown -R YOUR_USERNAME flutter
Run the first command again to verify that the apropriate user is now shown on the folder. Then try to create the project again.
Try resolving issues one by one. First resolve xcode issue using
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
After this
run
sudo gem install cocoapods
===
If this not works give output of following commands. Also can you tell if brew is installed?
$ruby -v
===
$ which ruby
===
I found that I had to first update gem itself:
sudo gem update --system
Then uninstall and reinstall Cocoapods:
sudo gem uninstall cocoapods
sudo gem install cocoapods
Only then would flutter doctor stop complaining that cocoapods was not installed.

This terminal won't let me run or install cocoa pods because I am on MacOS Catalina Beta?

I am interested in installing one of the GitHub repos that requires installing CocoaPods. There is no problem with my terminal (seems fine in a normal macOS version). I have one problem though: terminal is not installing CocoaPods, seemingly because I'm on the macOS Catalina beta?
I did install the pod 'Card' from Podfile which finished but after that Podfile closes. I am going running "pod install" on the terminal, then the only error that I get is:
-bash: /usr/local/bin/pod: /
System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory".
Does someone know how to fix this issue for macOS Catalina?
sudo gem install -n /usr/local/bin cocoapods
worked for me
Use
brew install cocoapods --build-from-source
The Mojave bottle is linked to a different version of Ruby. The --build-from-source option will link the cocoapods gem to the Catalina version of Ruby.
I also encountered this issue when I upgraded to Catalina and XCode 11. Here's what I did to fix this:
Select Command Line Tools in XCode.
XCode > Preferences > Locations > Command Line Tools > XCode 11.X.X
In terminal execute:
sudo gem install cocoapods -n /usr/local/bin
Try this to get cocopods works on macOS Catalina
$ brew cleanup -d -v
$ brew install cocoapods
I fixed it by installing cocoa pod again.
sudo gem install cocoapods -n /usr/local/bin
I had not been able to solve use this one
sudo gem install -n /usr/local/bin cocoapods
Before this command I ran the following command and reinstalled cocoapod.
xcode-select --install
.
This worked for me
xcode-select --install
sudo gem install -n /usr/local/bin cocoapods
I had this problem with Catalina, to solve I have to made the following steps:
Install XCode Command Line Tools, I recommend install the HomeBrew to solve that dependency:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Execute this command to reinstall cocoa pods: sudo gem install -n /usr/local/bin cocoapods
[![If cannot install new version cocoapods, example below:
1. Please remove Command line tools
sudo rm -rf /Library/Developer/CommandLineTools
2. Install new Command line tools version
sudo xcode-select --install
3. after installing run below command
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg]
Check this one, worked for me
Go to Xcode preferences -> Locations 'tab'.
Check the Command Line Tools section. If it's blank, make sure your current command line tools is selected.
XCode > Preferences > Locations > Command Line Tools > XCode 11.X.X
Run sudo gem install -n /usr/local/bin cocoapods
So, issue is that in Mac OSX Catalina. The folder path /usr/local/bin is private.
So,
Step 1: Install Homebrew. "Homebrew lets your access private folders and enables them to public".
Step 2: Restart Terminal or restart Mac OSX.
Step 3: Run sudo gem install cocoapods or sudo gem install -n /usr/local/bin cocoapods
Step 4: Let the setup complete
Step 5: Run pod setup
Finished :)
Try to install cocoapods using brew
brew install cocoapods --build-from-source
if u have already installed cocoapods using brew it will not let you install cocoapods
then try
brew link --overwrite cocoapods
then write
pod setup --verbose
hope it will work.

Resources