Permission denied
- 从报错的倒数第二行
Permission denied
可以看出是权限的问题,找了很久才发现flutter脚本的锅
- 找到
xcode_backend.sh
,它在flutter/packages/flutter_tools/bin
- 在144行将
chmod a_w
改成chmod a_x
- 或者复制下面片段覆盖对应的容
if [[ -e "${project_path}/.ios" ]]; then
RunCommand rm -rf -- "${derived_dir}/engine"
mkdir "${derived_dir}/engine"
RunCommand cp -r -- "${flutter_podspec}" "${derived_dir}/engine"
RunCommand cp -r -- "${flutter_framework}" "${derived_dir}/engine"
RunCommand find "${derived_dir}/engine/Flutter.framework" -type f -exec chmod a_x "{}" \;
else