Xcode 14.3 更新中 CocoaPods 使用时出现归档失败。

3

我正在尝试制作我的项目的存档,但它失败了,出现以下错误:

sync --delete -av --filter P .*.?????? --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Alamofire.framework" "/[AppPath]/Build/Intermediates.noindex/ArchiveIntermediates/QA/InstallationBuildProductsLocation/Applications/[APP NAME].app/Frameworks"
building file list ... rsync: link_stat "/[APP_PATH]../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Alamofire.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/9e200cfa-7d96-11ed-886f-a23c4f261b56/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9]
Command PhaseScriptExecution failed with a nonzero exit code
  • MacBook: M1 MacBook Pro
  • MacOS: Ventura 13.2.1
  • Xcode版本:14.3
  • Pods版本:1.12.0

以下是我的PODFILE:

# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'

target '[APP NAME]' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  pod 'Moya', '~> 14.0.0'
  pod 'Moya/RxSwift',' ~> 14.0.0'
  pod 'Eureka'
  pod 'SwiftSignalRClient'
  
  pod 'Kingfisher'
  #pod 'FMPhotoPicker', '~> 1.3.0'
  
  pod 'iOSDropDown'
  
  #Material TextFields
  pod 'MaterialComponents/TextControls+OutlinedTextAreas'
  pod 'MaterialComponents/TextControls+OutlinedTextFields'
  
  pod 'Blueprints'

  pod 'PhoneNumberKit'
  
  pod 'Firebase/Analytics'
  pod 'Firebase/Crashlytics'
  pod 'FirebaseMessaging'
  pod 'FittedSheets'


post_install do |installer|
      installer.generated_projects.each do |project|
            project.targets.each do |target|
                target.build_configurations.each do |config|
                    config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
                 end
            end
     end
  end

end

我也注意到,如果我通过软件包管理器添加依赖项,我的存档会成功,但是如果我使用CocoaPods,则应用程序存档会失败。


我遇到了类似的错误。我无法修复它,但我正在使用Xcode 14.2作为解决方法。 - Carsten
@Carsten请按照以下步骤操作 https://dev59.com/lPX_pIgB1922wOYJmy0e#75984932 。我找到了解决方案。 - Jatin
@Ali mehdi,请查看我的回答,同样的错误已经得到解决:https://dev59.com/lPX_pIgB1922wOYJmy0e#75984932 - Jatin
注意:在较新的Xcode中,某些路径发生了更改,因此我们需要在目标支持文件脚本中进行更改。 - Jatin
这个回答解决了你的问题吗?从xCode 14.2升级到14.3,PhaseScriptExecution失败并返回非零退出代码 - HangarRash
3个回答

4

此问题已在 CocoaPods 1.12.1 中得到修复。

更新 CocoaPods 后,还需在项目中更新您的 pods。

如果仍无法解决,请尝试以下步骤:

pod deintegrate
pod install

我需要 deintegrate 步骤,谢谢! - alex bird

2

- 第一步

将以下代码添加到您的Podfile中。('11.0' 取决于您的应用程序,请适当更改。)

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
         end
    end
  end
end

- 第二步

重新安装Pods。

pod deintegrate
pod install

- 第三步

  1. 在项目文件夹中打开“Pods-[您的应用名称]-frameworks.sh”文件。
  2. 找到代码source="$(readlink "${source}")"
  3. 在上述代码中插入'-f',如source="$(readlink -f "${source}")"

- 第四步(如果您使用Firebase崩溃分析)

  1. 在Xcode中通过以下路径打开“Build Phases”面板 “Targets> [您的应用程序名称] > Build Phases”
  2. 将“Firebase Crashlytics”移动到列表的末尾。 Build Phases

(在我的情况下,Xcode 14.3改变了构建阶段的顺序,导致出现问题。 因此,您应确认Firebase Crashlytics shell命令位于列表末尾)


兄弟,我应该在哪里按“Command + Shift + F”并查找source="$(readlink "${source}")"?你不觉得缺少了关键信息吗? - CrackIt
“Command + Shift + f” 是 Xcode 的全局搜索快捷键。 - AntoYang

-1

根据这个问题, 在更新了CocoaPods之后,我不得不在我的Podfile中添加以下内容。请确保再次运行'pod install':

post_install do |installer|
    installer.pods_project.targets.each do |target|
        # Fix libarclite_xxx.a file not found.
        target.build_configurations.each do |config|
            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
        end
    end
end

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接