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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/52510579/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:49:14  来源:igfitidea点击:

Xcode 10 command-line building: Archive failed with Fabric Info.plist Error

iosxcodexcode10auto-build

提问by General Failure

I have Jenkins server for autobuilding iOS project that has two targets. Project builds with command-line utility xcodebuild.

我有一个用于自动构建 iOS 项目的 Jenkins 服务器,它有两个目标。项目使用命令行实用程序构建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. But after updating each time I see error

在我将 Xcode 更新到版本 10 之前,它运行良好。但是每次更新后我看到错误

error: Fabric: Info.plist Error

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. You can also add '$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)' as an "Input Files" dependency for your Fabric run script build phase.

** ARCHIVE FAILED **

错误:织物:Info.plist 错误

无法在路径 /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。您还可以添加 '$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)' 作为 Fabric 运行脚本构建阶段的“输入文件”依赖项。

** 存档失败 **

After googling and reading error description I did open Build phasestab in Xcode and set up it (move Run scriptitem to bottom, check Run script only when installingand add $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)to Input files and also remove empty Run scriptitem).

在谷歌搜索和阅读错误描述后,我确实Build phases在 Xcode 中打开了选项卡并进行了设置(将Run script项目移到底部,检查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 scriptitem moved above and new empty Run scriptappeared. After that I did experiment: set up Build phases, rebuild project in Xcode GUI and saw that phases reordered again. So, it occurs during or after building.

我打开项目,查看构建阶段选项卡,看到该Run script项目移动到上方并Run script出现新的空白。之后我做了实验:设置构建阶段,在 Xcode GUI 中重建项目并看到这些阶段再次重新排序。因此,它发生在构建期间或之后。

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

回答by Elsammak

Okay, I got the solution form Fabrics. For Xcode 10, add this path to the Input Files in Build phase in XCode $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)

好的,我从 Fabrics 中得到了解决方案。对于 Xcode 10,将此路径添加到 XCode $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH) 中构建阶段的输入文件

enter image description here

在此处输入图片说明

回答by General Failure

I found crutch-like solution: select Legacy Build Systemat File-> Workspace Settings-> Build Systemin Xcode GUI.

我发现拐杖样的解决方案:选择Legacy Build SystemFile- > Workspace Settings- >Build System在Xcode GUI。

Why this solution is bad? Because of:

为什么这个解决方案不好?因为:

  • Legacy Build Systemis slower than New Build System (Default).

  • It's not Xcode setting but workspace. I.e. 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.

  • Legacy Build System比 慢New Build System (Default)

  • 这不是 Xcode 设置,而是工作区。即在 Jenkins 中清理工作区文件夹或某些版本控制系统操作后,将此设置重置为默认值,非工作选项将再次选择。

回答by Bhavik Modi

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"
  4. Build your project again.
  1. 转到构建设置
  2. 搜索“调试信息格式”
  3. 将“Debug”的值从“DWARF”更改为“DWARF with dSYM File”
  4. 再次构建您的项目。

Change "DWARF"

更改“矮人”

enter image description here

在此处输入图片说明

To "DWARF with dSYM File"

到“带有 dSYM 文件的 DWARF”

enter image description here

在此处输入图片说明

回答by sergiy batsevych

I moved "Run Script" with crashlytics to the end after "Embed pods Frameworks" and "Copy pods Resources" and that helpedenter image description here

在“嵌入 pods 框架”和“复制 pods 资源”之后,我将带有 crashlytics 的“运行脚本”移到最后,这有帮助在此处输入图片说明

回答by Hudi Ilfeld

I deleted derived data of the project and it resolved the issue

我删除了项目的派生数据并解决了问题