8

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
Arundeep Chohan
  • 9,779
  • 5
  • 15
  • 32
Sabih Khan
  • 477
  • 2
  • 6
  • 14
  • have you tried uninstalling and reinstalling cocoapods? https://superuser.com/questions/686317/how-to-fully-uninstall-the-cocoapods-from-the-mac-machine or `sudo gem install cocoapods --pre` – F-1 Jul 25 '19 at 12:08
  • No not yet i havent tried uninstalling it – Sabih Khan Jul 25 '19 at 13:25
  • Tried still doesnt work..it is still showing that cocoapods are installed but not initialized when doing pod setup it now shows curl 56 transfer instead of 18 – Sabih Khan Jul 25 '19 at 15:07

9 Answers9

11

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)

Andrés Robert
  • 129
  • 1
  • 5
4

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
Afinas EM
  • 2,755
  • 1
  • 15
  • 28
3

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.

brianbhsu
  • 670
  • 7
  • 12
2
sudo gem install cocoapods -v 1.10.0 -n /usr/local/bin
Omar
  • 185
  • 2
  • 14
2

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.

Mpho
  • 43
  • 8
0

Run the commands in your terminal (but not in the AndroidStudio for example):

sudo gem install cocoapods
pod setup

After, run:

flutter build ios
iegik
  • 1,429
  • 1
  • 18
  • 30
0

In flutter, I solve this issue by opening an android studio with terminal

use this line on your terminal

open /Applications/Android\ Studio.app
  • This is a duplicate of an of existing answe, by @mpho. When answering older questions that already have answers, please make sure you provide either a novel solution or a significantly better explanation than existing answers. Remember to review all existing answers first. – tjheslin1 Apr 07 '22 at 15:51
0

This worked for me

sudo gem install activesupport -v 6.1.7.2

sudo gem install cocoapods
SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34
0

This Problem comes to Macbook Pro M2 or Macbook M1 chip

[!] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    ✗ CocoaPods not installed.
        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 install see
      https://guides.cocoapods.org/using/getting-started.html#insta
      llation for instructions.

Solution: This is work for me I have to suggest trying you and run this command.

brew install cocoapods