Flutter项目,Xcode15, 编译正常,但archive报错

错误提示

shell 复制代码
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/目录/Developer/Xcode/DerivedData/Runner-brgnkruocugbipaswyuwsjsnqkzm/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-E132D1BC120460B2082A9DF7.sh (in target 'Runner' from project 'Runner')
    cd /Users/app目录/ios
    /bin/sh -c /Users/目录/DerivedData/Runner-brgnkruocugbipaswyuwsjsnqkzm/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Script-E132D1BC120460B2082A9DF7.sh

mkdir -p /Users/目录/Xcode/DerivedData/Runner-brgnkruocugbipaswyuwsjsnqkzm/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/Runner.app/Frameworks
Symlinked...
rsync --delete -av --filter P .*.?????? --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/device_info.framework" "/Users/目录/Developer/Xcode/DerivedData/Runner-brgnkruocugbipaswyuwsjsnqkzm/Build/Intermediates.noindex/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app/Frameworks"
building file list ... rsync: link_stat "/Users/app目录/ios/../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/device_info.framework" failed: No such file or directory (2)
done

sent 29 bytes  received 20 bytes  98.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files could not be transferred (code 23) at /AppleInternal/Library/BuildRoots/8e85887f-758c-11ee-a904-2a65a1af8551/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9]
Command PhaseScriptExecution failed with a nonzero exit code

Command PhaseScriptExecution failed with a nonzero exit code

解决办法:

1、升级ruby至2.7版本
shell 复制代码
# 安装ruby2.7(2.6.10对于新版本mac(macOS 13.6.4)不适用)
brew install ruby@2.7

# 安装cocoapods
gem install -n /usr/local/bin cocoapods -v 1.11.1
2、在 Pods-Runner-frameworks.sh 文件中进行以下替换:
shell 复制代码
if [ -L "${source}" ]; then
    echo "Symlinked..."
    source="$(readlink "${source}")"
fi

替换为:

shell 复制代码
if [ -L "${source}" ]; then
    echo "Symlinked..."
    source="$(readlink -f "${source}")"
fi
相关推荐
叽哥4 小时前
Flutter Riverpod上手指南
android·flutter·ios
BG19 小时前
Flutter 简仿Excel表格组件介绍
flutter
zhangmeng1 天前
FlutterBoost在iOS26真机运行崩溃问题
flutter·app·swift
恋猫de小郭1 天前
对于普通程序员来说 AI 是什么?AI 究竟用的是什么?
前端·flutter·ai编程
卡尔特斯1 天前
Flutter A GlobalKey was used multipletimes inside one widget'schild list.The ...
flutter
w_y_fan1 天前
Flutter 滚动组件总结
前端·flutter
大熊猫侯佩1 天前
桃花岛 Xcode 构建秘籍:Swift 中的 “Feature Flags” 心法
app·xcode·swift
悄然林静1 天前
Mac终端执行`brew doctor`报`openssl@1.1`警告
mac·xcode·apple
醉过才知酒浓1 天前
Flutter Getx 的页面传参
flutter
权咚2 天前
阿权的开发经验小集
git·ios·xcode