Articles/Flutter/Setting Up CocoaPods for FVM-managed Flutter Projects

Setting Up CocoaPods for FVM-managed Flutter Projects

A guide to installing CocoaPods for a Flutter project while using FVM to manage Flutter versions, ensuring a smooth setup for iOS development.

October 7, 2023·1 min read

When working with Flutter and managing different versions using FVM, setting up CocoaPods can present a challenge. This guide provides a straightforward approach to installing CocoaPods for a specific Flutter version managed by FVM.

Prerequisites

  • Ensure FVM is installed, and a specific Flutter version is set for your project.

Installing CocoaPods with FVM

  1. Determine the Path: Identify the path to the bin directory of the specific Flutter version managed by FVM. For instance, if you are using Flutter version 3.10.4, the path might look like this: /Users/<your-username>/fvm/versions/3.10.4/bin.
  2. Install CocoaPods: Utilize the identified path to install CocoaPods as follows:
BASH
sudo gem install -n /Users/<your-username>/fvm/versions/3.10.4/bin cocoapods
  1. Navigate to Your Project's iOS Directory:
BASH
cd <your-project-directory>/ios
  1. Install the Pods:
BASH
pod install