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 [email protected]

# 安装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
相关推荐
vvilkim2 小时前
Flutter 状态管理基础:深入理解 setState 和 InheritedWidget
前端·javascript·flutter
9765033353 小时前
iOS 审核 cocos 4.3a【苹果机审的“分层阈值”设计】
flutter·游戏·unity·ios
程序员老刘·3 小时前
iOS 26 beta1 真机无法执行hot reload
flutter·ios·跨平台开发·客户端开发
ZFJ_张福杰5 小时前
【Flutter】性能优化总结
flutter·性能优化
BAGAE6 小时前
使用 Flutter 在 Windows 平台开发 Android 应用
android·大数据·数据结构·windows·python·flutter
肥肥呀呀呀15 小时前
flutter 的lottie执行一次动画后关闭
开发语言·flutter
只可远观21 小时前
Flutter Android打包和发布Build APK
前端·flutter·dart
前端呆猿21 小时前
Vuex:Vue.js 应用程序的状态管理模式
android·vue.js·flutter
vvilkim1 天前
Flutter 导航与路由管理:Navigator 的深入解析与实践
前端·javascript·flutter
vvilkim1 天前
Flutter状态管理进阶:从基础到架构设计
前端·flutter