Cocoapods error after updating to Android Studio 2021.1.1 - ios

I updated yesterday to the new Android Studio 2021.1.1
Now i get the following error, when i run my app on the ios emulator:
Warning: CocoaPods is installed but broken. Skipping pod install.
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:
sudo gem install cocoapods
CocoaPods not installed or not in valid state.
I tried everything for many hours.
At the end i go back to Android Studio 2020 previous version and it works perfect.
Any ideas?
Update:
This works for me:
uninstall cocoapods then
reinstalling cocoapods via homebrew.
Afterwards I did an "pod repo update"

Related

Cannot install Cocoapods on M1 Chip

I am working on a Mac, M1 chip. I was working in React Native, when something happened with my system's configurations while trying to get the Android Build to work. No npm, npx, (any node commands really) worked, I couldn't do anything with my Pods, and essentially just everything was broken. I deleted and uninstalled everything to do with Node, Java, and Cocoapods but the issue I'm facing now is that I cannot install CocoaPods
I am following the directions from here and I am on my third try to just start a new React App. The Project will build, but I cannot install any pods and the whole app seems to not know that its supposed to be running off React as it won't let me use imported components.
So I have a plethora of issues in front of me, but the biggest is my inability to install CocoaPods.
I run...
brew install CocoaPods
and get the following return...
Warning: cocoapods 1.11.3 is already installed and up-to-date.
But upon running npx react-native init I get the following error...
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
So I tried as I was instructed, and attempted to run...
sudo arch -x86_64 gem install ffi
Which gives me this...
make install failed, exit code 2
And since that fails, I cannot successfully run...
arch -x86_64 pod install
So it looks like my code is breaking before I can even type a single line. I've been trying to just create a new React Project for hours now... this seems very overly complicated
Update your ruby to recent version, for that you can use rbenv via homebrew. After that install cocoapods via gem install
There must have been some sort of corruption or only partially installed dependency. I ended up wiping my hard drive and restoring everything, it worked after that

Facing issue while trying to init the pods on project

I hope you all are doing well.
I'm facing issue while trying to init the pod in the project. Cocoapods is already installed in the system. XCode Dev intstall is also there, In XCode in command line the xcode version is also selected. Don't know what I'm missing. I have MacOS BigSur.
If I run pod --version command on terminal it gives me version of 1.8.4.
I'm attaching the screenshot if someone has faced this issue.
I have the same issue. I solved it by following these steps:
First uninstall cocoapods with the command:
brew uninstall cocoapods
Reinstall Cocoapods:
sudo gem install cocoapods

can't update CocoaPods in flutter terminal from android studio

This is the full error message
Warning: CocoaPods minimum required version 1.9.0 or greater not installed. Skipping pod install.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
CocoaPods not installed or not in valid state.
Error launching application on iPhone 13.
any command which I can directly from the Android studio terminal to update CocoaPods?
Try to install with this command
brew link --overwrite cocoapods
Try to without home brew
1 - sudo gem uninstall cocoapods
2 - sudo gem install -n /usr/local/bin
3 - cocoapods pod install
so finally after waisting my whole day.
we can't update CocoaPods from very old version to new version so.
1 - sudo gem uninstall cocoapods
2-sudo gem install cocoapods:1.10.2

Flutter upgrade cocapods version

I'm trying to update my cocoapods version used by flutter. I already upgraded cocoapods by running sudo gem install cocoapods.
When I run pod --version anywhere in the terminal it returns version 1.10.1 but when I run it inside my flutter ios project (path myProject/ios) it returns version 1.9.3 and also flutter doctor tells me that cocoapods is using version 1.9.3.
I also tried running brew update and brew upgrade cocoapods as well as brew link --overwrite cocoapods.
Can anybody tell me how to align the version used inside my flutter project with the globally (?) installed cocoapods version?
After trying all of the commands in the question I also ran sudo gem update --system in my projects\ios folder which finally solved the problem.

unable to setup cocoapods. Cocoapods setup problem

I am trying to run my flutter app which is connected to Firebase, but when I try to run it on an iOS emulator, it shows these errors -
Warning: CocoaPods installed but not initialized. Skipping pod >install.
CocoaPods is used to retrieve the iOS and macOS platform side's >plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To initialize CocoaPods, run:
pod setup
once to finalize CocoaPods' installation.
So then I do "pod setup" but then it shows this error :
Cloning into 'master'...
remote: Enumerating objects: 14707, done.
remote: Counting objects: 100% (14707/14707), done.
remote: Compressing objects: 100% (14117/14117), done.
error: RPC failed; curl 18 transfer closed with outstanding read data
remaining
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
For me it was due to cocoapods version. You can use this in your terminal:
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.7.5
pod setup
A workaround for this issue is here:
https://github.com/flutter/flutter/issues/41253
and also here:
https://flutter.dev/docs/get-started/install/macos#deploy-to-ios-devices
(I'm using macOS Catalina JIC)
After updating the Flutter version, faced the same issue.
Tried installing and uninstalling cocoapods and still the same issue.
Finally, the issue resolved for me.
If you are using Android studio
File -> Invalidate Caches -> Invalidate and Restart
This should be fixed now with flutter version v1.9.1+hotfix.5 and above.
Try uninstalling all existing installations of cocoapods:
sudo gem uninstall cocoapods
brew uninstall cocoapods
Then install the latest version of cocoapods:
sudo gem install cocoapods
pod setup
I can confirm that this is working with flutter 1.12.13+hotfix.9 (stable channel), cocoapods version 1.9.1, on macOS Catalina v10.15.4.
sudo gem install cocoapods -v 1.10.0 -n /usr/local/bin
I was battling with this issue for days on end. The issue, for me was only when I use my Mac with M1 Chip. Initially, i got this error when I tried to add a audio player package to my project. After a week of seaching I came across the this solutionenter link description here
The worked perfectly until i needed to use a geolocation package and the issue was back again. After days of trying different solutions, I finally found that the solution that worked for me. I reinstalled cocoapods using brew. Once done, I closed the terminal, closed android studio then ran the following command on terminal open /Applications/Android\ Studio.app. Pod now installs with no issues and my project launches on iOS.
Run the commands in your terminal (but not in the AndroidStudio for example):
sudo gem install cocoapods
pod setup
After, run:
flutter build ios
In flutter, I solve this issue by opening an android studio with terminal
use this line on your terminal
open /Applications/Android\ Studio.app

Resources