简体   繁体   English

Xcode 10 命令行构建:存档失败,Fabric Info.plist 错误

[英]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 构建项目时,它总是成功。

Okay, I got the solution form Fabrics.好的,我从 Fabrics 中得到了解决方案。 For Xcode 10, add this path to the Input Files in Build phase in XCode $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)对于 Xcode 10,将此路径添加到 XCode $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH) 中构建阶段的输入文件

在此处输入图片说明

I moved "Run Script" with crashlytics to the end after "Embed pods Frameworks" and "Copy pods Resources" and that helped在“嵌入 pods 框架”和“复制 pods 资源”之后,我将带有 crashlytics 的“运行脚本”移到最后,这有帮助在此处输入图片说明

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 SystemNew 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 设置的解决方案:

  1. Go to Build Settings转到构建设置
  2. Search "Debug Information Format"搜索“调试信息格式”
  3. Change value of "Debug" from "DWARF" to "DWARF with dSYM File"将“Debug”的值从“DWARF”更改为“DWARF with dSYM File”
  4. Build your project again.再次构建您的项目。

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.

相关问题 Info.plist:权限被拒绝。 命令PhaseScriptExecution失败,退出代码为非零Xcode 10 - Info.plist: Permission denied . Command PhaseScriptExecution failed with a nonzero exit code Xcode 10 Xcode 6 / iOS-存档和Info.plist丢失 - Xcode 6/iOS - Archive & Info.plist missing 由于info.plist,存档提交失败 - Archive submission failed due to info.plist Swift / Xcode 6-info.plist错误 - Swift / Xcode 6 - info.plist error Xcode 10故事板和info.plist git diff无法正确显示 - Xcode 10 storyboard and info.plist git diff is not properly showing 错误:无法删除/ Users / gs / Library / Developer / Xcode / DerivedData-无法删除“ Info.plist” - error: failed to remove /Users/gs/Library/Developer/Xcode/DerivedData - “Info.plist” couldn’t be removed Xcode 11.3.1 无法从路径中的包加载 Info.plist - Xcode 11.3.1 Failed to load Info.plist from bundle at path Xcode 9:xcodebuild -exportArchive错误读取文件:info.plist - Xcode 9: xcodebuild -exportArchive Error Reading File: info.plist Xcode 7错误:无法从Info.plist中读取CFBundleIdentifier(null) - Xcode 7 error: could not read CFBundleIdentifier from Info.plist (null) 无法解析应用程序的Info.plist appcelerator工作室错误 - Failed to parse app's Info.plist appcelerator studio error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM