1st: Run these commands to remove old generated ios files
rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
rm ios/Podfile
2nd: Delete Podfile.lock (YourPoject/ios/Podfile.lock)
3rd: Run
flutter clean &&
cd ios/ &&
sudo gem install cocoapods --pre &&
pod deintegrate &&
cd .. &&
flutter pub get &&
cd ios/ &&
pod install --repo-update &&
cd .. &&
flutter build ios --debug --simulator
pod install --repo-update
(Make sure your cd into the iOS directory of the flutter app)