No type or protocol named 'FlutterPluginRegistrar'
I've struggled with this for some time, and I've found that eleomilagrosa's solution from here works:
I found out that the ios/Flutter/Flutter.framework got corrupted the files were all empty or blank.to fix it,just copy existing ios/Flutter/Flutter.framework from other working Flutter projects you have.then overwrite the corrupted ios/Flutter/Flutter.framework then build againReason:Flutter.framework got corrupted.How to identify if your Flutter.framework got corrupted?open ios/Flutter/Flutter.framework/Headers/Flutter.h if this file is empty or blank.