[!] FirebaseCore
requires CocoaPods version >= 1.12.0
, which is not satisfied by your current version, 1.11.3
.
THERE ARE TWO WAYS TO RESOLVE THIS ISSUE. BEFORE FOLLOWING THE STEPS BELOW, PLEASE CHECK WHICH METHOD IS SUITABLE FOR YOU:
✅ IF YOU INSTALLED COCOAPODS USING BREW
OR WANT TO SET IT UP WITH BREW
, GO WITH METHOD 2.
✅ ELSE, IF YOU USED GEM
(RUBY), FOLLOW METHOD 1.
Method 1: Update CocoaPods Using RubyGem (Traditional)
This method works best if you originally installed CocoaPods using RubyGems. Follow these steps:
Step 1: Check Your CocoaPods Version
If it shows 1.11.3 or lower, you need to update it. Run the following command:
pod --version
Step 2: Uninstall Old CocoaPods
Run:
sudo gem uninstall cocoapods
If CocoaPods is not installed, skip this step.
Step 3: Install the Latest CocoaPods Version
Now, install CocoaPods 1.12.0 or later:
sudo gem install cocoapods
Verify the installation:
pod --version
It should now display 1.12.0 or later.
Step 4: Update CocoaPods Dependencies
Navigate to your Flutter project’s ios
folder:
cd ios rm -rf Pods Podfile.lock pod repo update pod install --verbose
Step 5: Clean and Rebuild the Flutter Project
Go back to the project root:
cd .. flutter clean flutter pub get
Finally, run the app:
flutter run
If this method does not work due to system restrictions on macOS, proceed to Method 2.
Method 2: Update CocoaPods Using Homebrew (Recommended for macOS)
If your Mac restricts updating CocoaPods via Ruby, Homebrew is the best alternative.
Step 1: Check If Homebrew Is Installed
Run:
brew -v
If it’s not installed, install it using:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Step 2: Uninstall CocoaPods (If Previously Installed via RubyGem)
Run:
sudo gem uninstall cocoapods sudo rm -rf /Library/Ruby/Gems/*/gems/cocoapods* sudo rm -rf /usr/local/bin/pod
Step 3: Install CocoaPods Using Homebrew
Run:
brew install cocoapods
Then, verify:
pod --version
It should now be 1.12.0 or later.
Step 4: Reset CocoaPods in Your Flutter Project
Navigate to your project’s ios
folder:
cd ios rm -rf Pods Podfile.lock pod repo update pod install --verbose
Step 5: Clean and Rebuild the Flutter Project
Go back to the project root:
cd .. flutter clean flutter pub get
Finally, run the app:
flutter run
Which Method Should You Use?
Situation | Recommended Method |
---|---|
Installed CocoaPods via gem (Ruby) | Method 1 (RubyGem) |
macOS system prevents CocoaPods update | Method 2 (Homebrew) |
Fresh install on macOS | Method 2 (Homebrew) |
Conclusion
By following either of these methods, you can successfully update CocoaPods and resolve the FirebaseCore error in Flutter.
Other Articles