Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 400
Sabih Khan Avatar asked Jul 25 '19 11:07

Sabih Khan


People also ask

How do I know if CocoaPods is installed on my Mac?

To find if Cocoapods is installed or not run cmd (pod --version). if theresult is (Not Found) Pods is not installed.


3 Answers

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)

like image 152
Andrés Robert Avatar answered Nov 04 '22 21:11

Andrés Robert


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.

like image 28
brianbhsu Avatar answered Nov 04 '22 20:11

brianbhsu


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
like image 41
Afinas EM Avatar answered Nov 04 '22 20:11

Afinas EM