How to Install cocoaPods in Flutter?
Last Updated :
01 Jul, 2022
CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. Cocoapods helps you to manage and incorporate third-party libraries into your project without getting concerned about setting up and configuring your project.
Steps For Installation of CocoaPods
There are two ways to install cocoapods on your mac:
- Using Homebrew
- Using Gem
Note: It is much easier to install Cocoapods on mac using Homebrew than gem.
Installation of CocoaPods using Homebrew
Step 1: Open the terminal on your Mac.
Note: Before proceeding further, make sure your device has Homebrew already installed.
If you don't have Homebrew installed, head over to this article: HomeBrew – Installation on MacOS
Step 2: Once you have successfully installed Homebrew, run the following command on your terminal
brew install cocoapods
Ideally, it should look like something as shown below:
Step 3: Cocoapods has been successfully installed on your device. To verify the installation, run "pod --version" which would display the version of cocoapods installed on your device.
Installation of CocoaPods using gem
Step 1: Open the terminal on your Mac. One simple way to open your terminal is by searching "terminal" in the spotlight. Once the terminal window is opened, run the following command.
sudo gem update --system
CocoaPods is built with Ruby and is installable with the default Ruby available on macOS. The above command ensures that the gem installed on the system is up to date.
Step 2: If you encounter an error saying,
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/gem
then simply re-run the command.
Step 3: Gem installed on our system should be up to date now. In order to install cocoapods, run the following command on your terminal.
sudo gem install cocoapods
Step 4: If you encounter an error saying,
ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permission for the /usr/bin directory.
run the command given below.
sudo gem install cocoapods -n /usr/local/bin
Step 5: You have successfully installed cocoapods on your mac. To confirm the installation run
pod --version
additionally, we can run the following command to check if cocoapods is installed correctly or not.
flutter doctor
Similar Reads
How to Install Flutter in Eclipse? Flutter is a framework for building cross-platform applications (android, ios, web) which use Dart as its programming language. Before IDEs like Android Studio and VS code became popular, Eclipse used to be heavily used by developers. Now we can install dart inside our Eclipse IDE with the help of t
2 min read
How to Install Flutter App on Android? The hottest and trending cross-platform framework, Flutter is Google's SDK for crafting beautiful, fast user experiences for mobile, web, and desktop with just a single codebase, meaning you write for one, build for three. Flutter works with existing code, is used by developers and organizations aro
4 min read
How to Install HTTP Package in Flutter? Flutter is Googleâs Mobile SDK to build native iOS and Android apps from a single codebase. When building applications with Flutter everything towards Widgets â the blocks with which the flutter apps are built. The User Interface of the app is composed of many simple widgets, each of them handling o
2 min read
How to Install Flutter on Linux? In this article, we will learn how to install Flutter in Linux Flutter is an open-source UI software development kit created by Google. It is used to develop cross-platform applications for Android, iOS, Linux, Mac, Windows, Google Fuchsia, and the web from a single codebase. Installing Flutter on L
2 min read
How to Install and Setup Flutter in IntelliJ IDEA? As we all already know that Flutter is a cross-platform application development toolkit, It can be used to develop cross-platform apps for Android, iOS, Linux, macOS, etc. Now you can build apps using flutter in any Text-editor (try to use editors recommended by Flutter on their website to avoid any
7 min read
How to Install Flutter on Visual Studio Code? In this article, we will walk through the process of installing Flutter in Visual Studio Code. Flutter is an open-source portable UI framework for mobile, desktop, and web. It is developed and managed by Google, Flutter is used for creating a high-quality, beautiful, and fast native interface for an
4 min read