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.
- Ensure FVM is installed, and a specific Flutter version is set for your project.
Installing CocoaPods with FVM
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:
Install CocoaPods: Utilize the identified path to install CocoaPods as follows:
sudo gem install -n /Users/<your-username>/fvm/versions/3.10.4/bin cocoapods
Navigate to Your Project's iOS Directory
Install the Pods