For me, it was a Firebase issue... I had not correctly added Firebase dependencies to the Podfile.
I also received: Xcode build is missing expected TARGET_BUILD_DIR build setting.
Once I did, then I did a flutter clean and flutter run and it worked.
Add the Firebase pods for the products you want to use
pod 'FirebaseAnalytics' pod 'FirebaseAuth' pod 'FirebaseFirestore'
To the Podfile in the ios folder.