flutter升级后 运行项目报错 Warning: Podfile is out of date

3,852 阅读1分钟

报错如下:

Warning: Podfile is out of date
  This can cause a mismatched version of Flutter to be embedded in your app, which may result in App Store submission rejection or crashes.
  If you have local Podfile edits you would like to keep, see https://github.com/flutter/flutter/issues/24641 for instructions.
To regenerate the Podfile, run:
  rm ios/Podfile
  警告:Podfile已过期
   这可能会导致将不匹配的Flutter版本嵌入到您的应用中,这可能导致App Store提交被拒绝或崩溃。
   如果您要保留本地Podfile编辑,请参阅https://github.com/flutter/flutter/issues/24641了解说明。
要重新生成Podfile,请运行:
   rm ios / Podfile

解决办法:

大多数情况是在升级flutter版本后发生的,要解决此问题,请按照以下步骤操作

  1. 找到Podfile文件直接删除,路径项目名称/ios/Podfile,或者可以通过在项目根目录中运行以下命令来执行此操作
rm ios/Podfile
  1. Run再次项目,会再次创建一个新的或者更新Podfile文件。