Invalid Podfile file: undefined method flutter_relative_path_from_podfile

[!] Invalid `Podfile` file: undefined method `flutter_relative_path_from_podfile' for #<Pod::Podfile:0x00007fc913afc3f8>
Did you mean? flutter_ios_podfile_setup.

# from /Users/xxx/Podfile:16
# -------------------------------------------
#
> install_all_flutter_pods(flutter_application_path)
#
# -------------------------------------------

Flutter 混合开发过程中,升级降级遇到的问题。

本机Flutter 版本3.3.3,但是由于项目需要版本降到3.0.5,更换本地Flutter SDK 后,Flutter 工程需要重新生成一下。

flutter clean
flutter pub get
flutter build ios