cocoapods not installed in macos big sur flutter - macos

it's my first using macOS I downloaded big sur version and I had install flutter
when I run flutter doctor I see this problem
Idk how to solve it
and i saw many answers here but still not working

it fixed when i install homebrow

If you are using an M1 mac, you can download ffi first by this command:
sudo arch -x86_64 gem install ffi
then run pod commands like this :
arch -x86_64 pod install

Related

cocopods-genrate plugin not found

System
OS : macOS (12.6.1)
CPU : Intel (R) Core - i5
JAVA : OpenJdk 19
Xcode : 14.1
ruby : 2.7
gems : 3.3.11
Im trying to set up the environment for Kotlin Multiplatform for iOS and Android i installed kdoctor, Xcode, Android Studio,OpenJdk and ruby2.7.
Everything is working according to plan but i'am not able to install cocoapods and cocoapods-genrate i tried official documentation of cocoapods https://guides.cocoapods.org/using/getting-started.html#installation and used this command. but kdoctor is not ditectiong cocoapods,
sudo gem install cocoapods
i also tried brew method by this command
brew install cocoapods
now cocoapods is detected but cocoapods-genrate plugin is not detected. and showed this message
"* cocopods-genrate plugin not found
Get cocopods-genrate from https://github.com/square/cocoapods-generate#installation"
i tred this command but nothing happend.
gem install cocoapods-generate
how to properly install cocopods and cocopods-genrate to set up the environment for Kotlin Multiplatform for iOS and Android?
I used this command to install cocoapods
sudo gem install -n /usr/local/bin cocoapods
Then this command to install cocoapods-generate
sudo gem install -n /usr/local/bin cocoapods-generate
and finaly pod setup --verbose to setup the cocoapods.
I followed this answer and now cocoapods and cocoapods-generate is ditected by kdoctor.
How do I install CocoaPods?

Failed task "pod install" on M1 macOS

I am trying to install pods for a react native app , but I can't install the pods. I tried several times with different approaches like the following:
sudo arch -x86_64 gem install ffi and arch -x86_64 pod install
or installing via rosetta terminal
or installing with homebrew
or switching to another ruby version (ruby-2.7.5) with rvm use
but pod install always fails with the following error message: incompatible library version - /Users/user/.rvm/gems/ruby-3.0.0/gems/ffi-1.15.5/lib/ffi_c.bundle it seems like the current ruby version is not compatible with the ffi and the cocoapods version.
Can anyone help me or have another idea why it does not work?
I think another problem could be that it uses different ruby versions within the process of installation because I have ruby installed with homebrew and on another location too.
Steps to follow :
-> remove pods from your system and install it via homebrew
-> close the terminal and start new terminal
-> remove node modules from the project
-> remove pods folder in ios
-> remove podfile.lock
For a clear understanding follow this solution

How to install properly CocoaPods on Macbook M1 Silicon

I am trying to install Cocoa Pods on my new MacBook Pro with the M1 Chip.
There are some solutions that found from December. Since is February those solutions may be a little outdated.
I cannot find any instructions on CocoaPods website. Would anyone be able to help me with that matter? I want to do it right and, sadly, I have little knowledge about that topic.
Many thanks for help.
These are the steps I followed :
Install HomeBrew in M1 Mac, open the Rosetta Terminal and run the following command :
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
After Homebrew installation is done, run this command in the terminal :
brew install cocoapods
I have mac Pro M1, Try to run on x86_64 architecture:
sudo arch -x86_64 gem install ffi
Then at the root of your project
arch -x86_64 pod install
For me was the solution through the Homebrew.
Install Homebrew natively on M1
https://docs.brew.sh/Installation#alternative-installs
Then install Cocoapods
https://formulae.brew.sh/formula/cocoapods

macOS 11.0.1 - Flutter doctor gives cocopods error

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 :)

Invalid `Podfile` file: Unable to locate the executable `node`

I'm trying to run my App on IMB Cloud. Server run is OK. NPM Installed and Started. When POD Install from cd /ios it shows error:
denisbondar#MBP-Denis ios % pod install
[!] Invalid Podfile file: [!] Unable to locate the executable node.
# from /Users/denisbondar/Documents/kickapp/starter-kit/mobile-app/ios/Podfile:48
# -------------------------------------------
#
use_native_modules!
# end
# -------------------------------------------
Any thoughts? Thanks!
I had the same Issue. As I was trying to run a React Native App, and I needed some node module I have to run
brew install node
Just had the same issue, after updating cocoa pods the installation passed:
sudo gem install cocoapods
brew remove cocoapods && sudo gem install cocoapods
If you're running into this issue on an M1 Mac, this is what fixed it for me:
sudo arch -x86_64 gem install ffi
In your /ios directory:
arch -x86_64 pod install
I am aware that the commands I ran in order to fix my build have already been mentioned on this page, but I'll try to provide the order I ran them + some backstory.
For me the problem was that I've initally installed cocoapods using homebrew and I couldn't get it to update past version 1.5.2. Tried different approaches but pod --version still printed 1.5.2.
Then I've tried installing cocoapods using gems with:
sudo gem install cocoapods
Even if it displayed that the installation of cocoapods 1.10.1 was successful, the command line from terminal still pointed to the homebrew version of cocoapods, and pod --version still printed out 1.5.2. So I had to remove it, by calling:
brew remove cocoapods
After that the command line pointed to the gems version of cocoapods (1.10.1). And the build was successful.
BEWARE I AM MAC OS NOOBIE SO PROCEED WITH CAUSION FOR THE NEXT PART
Also, my friend tried to follow the exact same steps and his build still failed until he tried installing:
sudo arch -x86_64 gem install ffi
then after the installation he ran:
arch -x86_64 pod install
Again, I am a MAC OS noobie, so I don't understand very well yet what's the deal with this ffi. It just helped my friend getting his build done, so I thought it might also help somebody else.
For me problem was that I have cocoa pods installed by brew install cocoapods and brew install --cask cocoapods.
So to fix I run
brew remove cocoapods
brew remove --cask cocoapods
brew install cocoapods
After that I have latest version of cocoapods and everything worked.

Resources