Flutter iOS开发报错:项目目录未找到Podfile(M1芯片Mac Monterey)
解决Flutter iOS端「No `Podfile' found in the project directory」错误
针对M1芯片的macOS Monterey系统下,Flutter应用适配iOS时出现的Podfile找不到错误(即便项目中已存在Podfile),可按以下步骤解决:
切换到正确目录执行Pod命令
终端默认可能未进入项目的ios子目录,先执行cd 你的项目名/ios进入对应目录,再运行pod install,完成后回到项目根目录执行flutter run。清理并重建依赖
在项目根目录依次执行:flutter clean flutter pub get之后进入ios目录执行
pod install --repo-update,更新Pod仓库并重新安装依赖。适配M1芯片架构
如果是架构兼容性问题,可通过两种方式解决:- 右键终端图标,选择「使用Rosetta打开」后再执行上述命令;
- 在ios目录直接执行
arch -x86_64 pod install,强制以x86架构运行Pod命令。
内容的提问来源于stack exchange,提问作者Jorge Garciaparadela
相关产品推荐
相关产品推荐

