You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

归档项目时遇到Cocoapods(AFNetworking)问题

问题

构建遗留Objective-C项目至80%时失败,报错如下:

mkdir -p /Users/myusername/Library/Developer/Xcode/DerivedData/MyApp-cghzlwxuhadyvrehqungfijxixti/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/BuildProductsPath/Release-iphoneos/MyApp.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/AFNetworking.framework" "/Users/myusername/Library/Developer/Xcode/DerivedData/MyApp-cghzlwxuhadyvrehqungfijxixti/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app/Frameworks"

building file list ... rsync: link_stat
 "/Users/myusername/myapp_ios/MyApp/../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AFNetworking.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/97f6331a-ba75-11ed-a4bc-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9]
Command PhaseScriptExecution failed with a nonzero exit code

已尝试操作:

  • 重新安装Pods
  • 清理Derived Data
  • 重启Xcode及电脑
解决方案

针对rsync无法找到AFNetworking.framework的问题,可尝试以下步骤:

  • 检查Podfile与版本兼容性:确认AFNetworking版本适配当前Xcode、iOS系统版本。遗留项目建议锁定原使用版本,或升级至兼容的稳定版,避免版本不匹配导致framework未正确生成。
  • 调整AFNetworking Target的Build Settings:
    1. 打开Pods项目,选中AFNetworking target
    2. 找到Build Settings中的Skip Install,设置为NO(归档流程需要将framework安装到UninstalledProducts目录)
    3. 确认Installation Directory配置为@executable_path/../Frameworks
  • 修正项目路径配置:
    1. 打开主项目的Build Settings,搜索Per-configuration Build Products Path
    2. 核对Release-iphoneos对应的路径是否与报错中的路径一致,避免相对路径解析错误
  • 调整Pods脚本路径:若相对路径解析异常,可修改Pods项目内的Copy Pods Frameworks脚本,将相对路径替换为绝对路径,或调整路径层级以正确指向AFNetworking.framework的实际生成位置
  • 完全重建Pods环境:执行pod deintegrate彻底移除现有Pods集成,再重新执行pod install,确保Pods项目配置文件正确生成

内容的提问来源于stack exchange,提问作者Guard P

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.10 11:58:14