从 xCode 14.2 升级到 14.3 时,PhaseScriptExecution 失败,出现了非零的退出代码。

huangapple go评论57阅读模式
英文:

Upgrade from xCode 14.2 to 14.3 PhaseScriptExecution failed with a nonzero exit code

问题

我已经从Xcode 14.2升级到Xcode 14.3 beta,现在无法为任何iOS设备(arm64)进行存档,出现以下错误:

PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks

mkdir -p /Users/max/Library/Developer/Xcode/DerivedData/Max-dmwafkgdrzqavzcmbdjbjgmmuxby/Build/Intermediates.noindex/ArchiveIntermediates/Release_preprod/BuildProductsPath/Release_preprod-iphoneos/MaxApp.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/ActionSheetPicker_3_0.framework" "/Users/max/Library/Developer/Xcode/DerivedData/Max-dmwafkgdrzqavzcmbdjbjgmmuxby/Build/Intermediates.noindex/ArchiveIntermediates/Release_preprod/InstallationBuildProductsLocation/Applications/MaxApp.app/Frameworks"

building file list ... rsync: link_stat "/Users/max/Workspace/MaxApp/../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/ActionSheetPicker_3_0.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

为什么在Xcode 14.2中正常运行,而在Xcode 14.3 beta中不正常?我尝试删除[CP] Embed Pods Frameworks脚本,但它重新创建并出现相同的问题。我尝试在模拟器中构建和调试,一切正常。我尝试删除.pbxproj文件中的"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;

英文:

I've upgraded from xcode 14.2 to xcode 14.3 beta, and now I can't archive anymore for Any iOS Device (arm64) with the following error :

PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks

mkdir -p /Users/max/Library/Developer/Xcode/DerivedData/Max-dmwafkgdrzqavzcmbdjbjgmmuxby/Build/Intermediates.noindex/ArchiveIntermediates/Release_preprod/BuildProductsPath/Release_preprod-iphoneos/MaxApp.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/ActionSheetPicker_3_0.framework" "/Users/max/Library/Developer/Xcode/DerivedData/Max-dmwafkgdrzqavzcmbdjbjgmmuxby/Build/Intermediates.noindex/ArchiveIntermediates/Release_preprod/InstallationBuildProductsLocation/Applications/MaxApp.app/Frameworks"

building file list ... rsync: link_stat "/Users/max/Workspace/MaxApp/../../../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/ActionSheetPicker_3_0.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

Any idea why it works fine with xCode 14.2 and not with xCode 14.3 beta please ?

I tryed to delete the [CP] Embed Pods Frameworks script, but it has re-created it and get the same issue.
I tryed to build and debug in a simulator, and it works fine.
I tryed to delete "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; in the .pbxproj file

答案1

得分: 81

针对那些在Xcode 15中遇到此问题的人更新:

解决这个问题是我一生中最棘手的错误之一。

我为Flutter项目解决了这个问题,对于你的情况,可能是原生iOS项目。

做以下操作更容易:

1- 使用XCode打开你的项目

2- 搜索"Symlinked..."

3- 将source="$(readlink "${source}")"替换为source="$(readlink -f "${source}")"

4- 再次尝试构建你的项目或导出ipa,它应该正常工作

从 xCode 14.2 升级到 14.3 时,PhaseScriptExecution 失败,出现了非零的退出代码。

有关更多详细信息,请参考此处

英文:

Updated for those who are facing this in Xcode 15:

Resolving this problem was one of the most tricky errors in my life..

I resolved this for a Flutter project, in your case it might be a native iOS project.

It's easier to do the following:

1- Open your project using XCode

2- Search of "Symlinked..."

3- Replace source="$(readlink "${source}")" with source="$(readlink -f "${source}")"

4- Try again to build your project or export your ipa it should work

从 xCode 14.2 升级到 14.3 时,PhaseScriptExecution 失败,出现了非零的退出代码。

For reference check more details here

答案2

得分: 17

更新 2:2023年4月18日,新的CocoaPods版本1.12.1终于发布了 🥳,它包含了解决此问题所需的修复:https://github.com/CocoaPods/CocoaPods/releases/tag/1.12.1

注意:如果您在项目中编辑文件以解决问题,或切换到CocoaPods的主分支,那么您可能希望撤消这些更改,因为由于CocoaPods 1.12.1的发布,这些更改不再需要,如果保留这些更改,将来可能会遇到问题,详细信息请参见我在此工单末尾的“编辑”。

更新 1:具有修复的拉取请求(在我最初的答案中提到)已合并到CocoaPods的主分支中(于4月3日:https://github.com/CocoaPods/CocoaPods/issues/11808#issuecomment-1494709564),但尚未发布,它应该成为下一个版本1.12.1的一部分(正如维护者之一在此处评论:https://github.com/CocoaPods/CocoaPods/pull/11828#issuecomment-1496357883),但截至目前尚未发生(您可以在此处查看版本发布列表:https://github.com/CocoaPods/CocoaPods/releases)

如果您使用ruby gem来安装cocoapods,不想降级从Xcode 14.3到14.2(如我在最初的答案中所描述的),那么您可以手动切换到cocoa pods的主分支,使用以下命令:

git clone https://github.com/CocoaPods/CocoaPods.git --branch master
cd CocoaPods
gem build cocoapods.gemspec
gem install ./cocoapods-*.gem

最后,您需要手动从项目中删除先前安装的pods以及pods锁定文件,然后使用特定于您的框架的命令重新构建pods文件夹(例如,对于capacitor,请使用npx cap sync),或使用此命令:

pod install

最初的答案:我遇到了类似的问题,似乎与CocoaPods有关,关于此问题有一个工单:https://github.com/CocoaPods/CocoaPods/issues/11808#issuecomment-1481244508

一个GitHub用户已经提交了一个可能的修复拉取请求:https://github.com/CocoaPods/CocoaPods/pull/11828

如果您希望自己应用修复而不想等待发布,您可以按照修复的作者建议的方式进行操作(在他的后续评论中提到:https://github.com/CocoaPods/CocoaPods/issues/11808#issuecomment-1480802886):

> 解决方法是更新所有生成的...-frameworks.sh文件,为readlink的调用添加-f标志。换句话说,用以下内容替换:

source="$(readlink "${source}")"

> 用以下内容替换

source="$(readlink -f "${source}")"

如果您向下滚动一个评论,您会找到另一位GitHub用户的评论,提供了另一个临时解决方案,即将xcode构建工具从14.3降级到14.2以进行构建(适用于IDE中的构建和Xcode云中的构建):

以下是该工单中的屏幕截图,显示如何在Xcode IDE中从14.3命令行工具版本降级到14.2版本:

> 在您的Xcode IDE(Xcode 14.3)中,转到“设置”,打开“位置”选项卡,然后选择“命令行工具”并选择“Xcode 14.2 (14C18)”

从 xCode 14.2 升级到 14.3 时,PhaseScriptExecution 失败,出现了非零的退出代码。

如果您使用Xcode云进行构建,请参考此屏幕截图来更改工作流程中的Xcode版本(您可以在Xcode IDE或应用商店连接网站(https://appstoreconnect.apple.com/)中编辑工作流程):

> 编辑您的“工作流程” > “环境”,然后选择Xcode版本为“Xcode 14.2 (14C18)”(而不是14.3)

从 xCode 14.2 升级到 14.3 时,PhaseScriptExecution 失败,出现了非零的退出代码。

编辑:我建议关注1.12.1版本的发布,地址在这里:https://github.com/CocoaPods/CocoaPods/releases,这个版本将包含修复,您还可以订阅GitHub工单和拉取请求(如上所述),这样当修复发布时,您就不需要手动降级Xcode版本了(使用最新版本总是最好的,如果保持降级,将来会引起麻烦,因为您用于应用程序的软件包和工具将与Xcode 14.2不兼容),或者如果选择使用CocoaPods的主分支,您可能会在发布后要撤消那些更改,以确保再次使用发布版本而不是主分支(主分支可能包含仍处于测试阶段的功能,与被视为稳定的发布版本相比,可能不太稳定)。

英文:

Update 2: On the 18th of April 2023 the new CocoaPods version 1.12.1 got finally released 🥳 and it includes the fixes needed to solve the problem that this ticket is about: https://github.com/CocoaPods/CocoaPods/releases/tag/1.12.1

Note: if you edited files in your project to solve the problem, or switched to the master branch of CocoaPods, then you might want to undo those changes as they are not needed anymore due to the release of CocoaPods 1.12.1, if you keep the changes you might run into problems in the future, see my "EDIT" at the end of this ticket for more

Update 1: the pull request with a fix (mentioned in my initial answer) has been merged into the master branch of cocoapods (on april 3rd: https://github.com/CocoaPods/CocoaPods/issues/11808#issuecomment-1494709564) but it is not yet in a release, it should be part of the next release 1.12.1 (as one of the maintainers commented here: https://github.com/CocoaPods/CocoaPods/pull/11828#issuecomment-1496357883) but as of now this has not happend yet (you can keep an eye on the releases list here: https://github.com/CocoaPods/CocoaPods/releases)

if you use ruby gem to install your cocoapods and don't want to do the downgrade from Xcode 14.3 to 14.2 (as described in my initial answer) then you can switch manually to the master branch of cocoa pods using the following commands:

git clone https://github.com/CocoaPods/CocoaPods.git --branch master
cd CocoaPods
gem build cocoapods.gemspec
gem install ./cocoapods-*.gem

and finally you need to manually remove the previously installed pods as well as the pods lock file from your project, then re-build the pods folder using the command specific to your framework (for example for capacitor use: npx cap sync) or use this command:

pod install

Initial answer: I have a similar issue, it seems to be related to cocoa pods, there is a ticket about the problem here: https://github.com/CocoaPods/CocoaPods/issues/11808#issuecomment-1481244508

a pull request with a potential fix has already been submited by a github user: https://github.com/CocoaPods/CocoaPods/pull/11828

if you want to apply the fix yourself and not wait for a release, you can do what the author of the fix suggested (in his follow up comment: https://github.com/CocoaPods/CocoaPods/issues/11808#issuecomment-1480802886):

> Workaround is to update all the generated ...-frameworks.sh files to add the -f flag to the call to readlink. In other words, replace:

source="$(readlink "${source}")"

> with

source="$(readlink -f "${source}")"

if you scroll down one comment you will find a comment by another github user with a another temporary solution which is to downgrade to xcode build tools from 14.3 to 14.2 for builds (works for both builds in the IDE and builds in the xcode cloud):

here are the screenshots from that ticket, showing how to downgrade from 14.3 command line tools version to a 14.2 version in the Xcode IDE:

> in your Xcode IDE (Xcode 14.3) go to "Settings" open the "Locations" tab and then select "Command Line Tools" and choose "Xcode 14.2 (14C18)"

从 xCode 14.2 升级到 14.3 时,PhaseScriptExecution 失败,出现了非零的退出代码。

and if you are using the Xcode cloud to do your builds, refer to this screenshot instead to change the Xcode version in your workflow (you can edit the workflow either in your Xcode IDE or on the appstore connect website (https://appstoreconnect.apple.com/)):

> edit your "workflow" > "Environment" and then select as Xcode Version "Xcode 14.2 (14C18)" (instead of 14.3)

从 xCode 14.2 升级到 14.3 时,PhaseScriptExecution 失败,出现了非零的退出代码。

EDIT: I recommend watching for a 1.12.1 release here: https://github.com/CocoaPods/CocoaPods/releases which will have the fix, you can also subscribe to the github ticket and PR (mentioned above), so that when the fix is released you don't manually downgrade the xcode version anymore (it is always best to use the latest version, if you keep it downgraded it will cause trouble in the future as at some point packages and tools you use for your app will not be compatible with xcode 14.2) or if you chose to use the cocoapods master branch, you might after the release want to undo that change so that you are sure to use the release version again and not the master branch (the master branch might include features that are still unstable because they are in beta compared to the release version which is deemed to be stable)

答案3

得分: 2

如果您使用的是Xcode或Xcode Cloud,请降级到14.2版本。

对于Xcode:

从 xCode 14.2 升级到 14.3 时,PhaseScriptExecution 失败,出现了非零的退出代码。

对于Xcode Cloud:

从 xCode 14.2 升级到 14.3 时,PhaseScriptExecution 失败,出现了非零的退出代码。

英文:

If you used Xcode or Xcode Cloud, just downgrade to 14.2.

For Xcode:

从 xCode 14.2 升级到 14.3 时,PhaseScriptExecution 失败,出现了非零的退出代码。

For Xcode Cloud:

从 xCode 14.2 升级到 14.3 时,PhaseScriptExecution 失败,出现了非零的退出代码。

答案4

得分: 0

如果你在 Xcode 14.3 中导出构建时遇到错误,有个好消息 - Cocoapods 将会发布一个修复这个问题的版本(1.12.1)。

与此同时,你可以尝试以下解决方案:导航到 Pods/Target Support Files/Pods-ProjectName/ 目录,打开 Pods-ProjectName-frameworks.sh 文件。然后,将第 44 行的代码 "$(readlink "${source}")" 替换为 "$(readlink -f "${source}")"

来源:https://github.com/CocoaPods/CocoaPods/pull/11828

Cocoapods 版本 1.12.1 尚未发布。

希望能够解决问题。

英文:

If you're encountering an error while exporting a build in Xcode 14.3, there's good news - Cocoapods will be releasing a build (version 1.12.1) soon that addresses the issue.

In the meantime, you can try the following solution: navigate to the Pods/Target Support Files/Pods-ProjectName/ directory and open the Pods-ProjectName-frameworks.sh file. Then, replace line 44 with code "$(readlink "${source}")" with "$(readlink -f "${source}")".

Source: https://github.com/CocoaPods/CocoaPods/pull/11828

The cocoapods version of 1.12.1 is yet to release.

Hope it will work.

huangapple
  • 本文由 发表于 2023年2月18日 00:12:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/75486713.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定