Try "flutter upgrade"
If the build works well on Android, it could be a problem with xcode configuration. It's not the code.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: