[英]Xcode 10 command-line building: Archive failed with Fabric Info.plist Error
I have Jenkins server for autobuilding iOS project that has two targets.我有用于自动构建 iOS 项目的 Jenkins 服务器,它有两个目标。 Project builds with command-line utility xcodebuild
.使用命令行实用程序xcodebuild
构建项目。
Full commands are完整的命令是
/usr/bin/xcodebuild -workspace "Our project.xcworkspace" -scheme "First target" -configuration Release archive DEVELOPMENT_TEAM=TEAMCODE -allowProvisioningUpdates
and和
/usr/bin/xcodebuild -workspace "Our project.xcworkspace" -scheme "Second target" -configuration Release archive DEVELOPMENT_TEAM=TEAMCODE -allowProvisioningUpdates
Before I did update Xcode to version 10 it works perfectly.在我将 Xcode 更新到版本 10 之前,它运行良好。 But after updating each time I see error但是每次更新后我看到错误
error: Fabric: Info.plist Error错误:织物:Info.plist 错误
Unable to process Info.plist at path /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/Our_project-xxxx/Build/Intermediates.noindex/ArchiveIntermediates/Our project/BuildProductsPath/Release-iphoneos/First application.app/Info.plist This could be a timing issue, make sure the Fabric run script build phase is the last build phase and no other scripts have moved Our application.app from the location Xcode generated it.无法在路径 /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/Our_project-xxxx/Build/Intermediates.noindex/ArchiveIntermediates/Our project/BuildProductsPath/Release-iphoneos/First application.app/Info 处处理 Info.plist .plist 这可能是一个时间问题,请确保 Fabric 运行脚本构建阶段是最后一个构建阶段,并且没有其他脚本从 Xcode 生成它的位置移动了我们的 application.app。 You can also add '$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)' as an "Input Files" dependency for your Fabric run script build phase.您还可以添加 '$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)' 作为 Fabric 运行脚本构建阶段的“输入文件”依赖项。
** ARCHIVE FAILED ** ** 存档失败 **
After googling and reading error description I did open Build phases
tab in Xcode and set up it (move Run script
item to bottom, check Run script only when installing
and add $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
to Input files and also remove empty Run script
item).在谷歌搜索和阅读错误描述后,我确实在 Xcode 中打开了Build phases
选项卡并进行了设置(将Run script
项移到底部, Run script only when installing
检查Run script only when installing
并将$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
到输入文件并删除空Run script
项)。
Manual building from command line now works - it seems like problem solved.从命令行手动构建现在可以工作了 - 问题似乎解决了。 Even Jenkins did build first target!甚至詹金斯也确实建立了第一个目标! But secong target did not with same error.但是第二个目标并没有出现同样的错误。
I did open project, look Build phases tab and saw that Run script
item moved above and new empty Run script
appeared.我打开项目,查看构建阶段选项卡,看到Run script
项移动到上方并出现新的空Run script
。 After that I did experiment: set up Build phases, rebuild project in Xcode GUI and saw that phases reordered again.之后我做了实验:设置构建阶段,在 Xcode GUI 中重建项目并看到这些阶段再次重新排序。 So, it occurs during or after building.因此,它发生在构建期间或之后。
How can I fix this bug?我该如何修复这个错误?
Say, can I order build phases manually from command line?说,我可以从命令行手动订购构建阶段吗? If yes, I just append row in Jenkins step.如果是,我只是在 Jenkins 步骤中附加行。
In addition: this error appears only in command-line building.另外:此错误仅出现在命令行构建中。 When I build project from Xcode GUI it always succeeds.当我从 Xcode GUI 构建项目时,它总是成功。
I found crutch-like solution: select Legacy Build System
at File
-> Workspace Settings
-> Build System
in Xcode GUI.我找到了类似拐杖的解决方案:在File
-> Workspace Settings
-> Build System
in Xcode GUI 中选择Legacy Build System
。
Why this solution is bad?为什么这个解决方案不好? Because of:因为:
Legacy Build System
is slower than New Build System (Default)
. Legacy Build System
比New Build System (Default)
慢。
It's not Xcode setting but workspace.这不是 Xcode 设置,而是工作区。 Ie after cleaning workspace folder in Jenkins or some version control system actions will reset this setting to default, and non-working option will select again.即在 Jenkins 中清理工作区文件夹或某些版本控制系统操作后,将此设置重置为默认值,非工作选项将再次选择。
Solution to complete the setup of Crashlytics and/or Fabric using following:使用以下方法完成 Crashlytics 和/或 Fabric 设置的解决方案:
Change "DWARF"更改“矮人”
To "DWARF with dSYM File"到“带有 dSYM 文件的 DWARF”
我删除了项目的派生数据并解决了问题
将$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
放在Build Phases
Run Script
Input Files
下
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.