Install cocoapods for flutter dev

There is a time when you run ‘flutter doctor’ and then you got this problem below. 

[!] Xcode - develop for iOS and macOS
    ! CocoaPods 1.8.4 out of date (1.10.0 is recommended).
        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.

It means that you need to install cocoapods. Well it is a pretty clear message right. And if you follow the link, you will be asked to execute this command below:

sudo gem install cocoapods

But when I executed this piece of command line, I got another error message which was:

ERROR:  Error installing cocoapods:
        ERROR: Failed to build gem native extension.

Solution:

brew cleanup -d -v 

brew install cocoapods

And hopefully you will not encountered any other issues while installing the cocoapods. In my case I need to do extra overwrite the link such as this:

brew link --overwrite cocoapods

Then tried to run the ‘flutter doctor’ again and check if there is no more error.

Leave a Reply

Your email address will not be published. Required fields are marked *