After the top solution didn't work for me, I finally found my issue.
I opened xcodeproj instead of xcodeworkspace.
In summary, try:
1- flutter clean && flutter pub get && cd ios && pod install && cd .. && flutter build ios
2- Check that xcode has xcodeworkspace
open and not xcodeproj
.