Here are some common Pod related problem fixings that I've faced during developing Flutter apps for iOS.
The most common problem in flutter with firebase is in it's setup on ios!
On Firebase console, don't follow step 3 (Add Firebase SDK) and step 4 (Add initialization code), as it's described on Flutter documentation.
But unfortunately it shows error after doing so, it shows
ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'firebase_admob' not found @import firebase_admob; ~~~~~~~^~~~~~~~~~~~~~ 1 error generated.
There is a lot of solution on stackover flow, manually writing pod file, and install them it seems also working. But let the flutter do this...
- Manually Delete
ios/.symlinks
- Manually Delete
ios/Pods
- Manually Delete
ios/Podfile
- Manually Delete
ios/Podfile.lock
- Then in terminal
flutter clean && flutter run
It will take some time to install the pod... Have a cup of coffee now.. Woohoo
It happens when podfile doesn't contain any dependencies, to solve this problem run these commands on your mac terminal / VS Code terminal, make sure you close Xcode.
cd ios
pod cache clean --all
rm Podfile
flutter clean
pod init
flutter pub get
pod install
It's actually easy to solve, it's because you updated the packages version, but it didn't refelct on pubspec.lock file, To fix this error just follow this
Navigate to your ios foler first
cd ios
Then write this
pod update
Do these steps on your terminal on /ios
folder
rm -rf ~/.cocoapods/repos/Spec_Lock
rm -rf ~/.cocoapods/repos/trunk/
Then
flutter clean && flutter run
Fixed!!!