简体   繁体   English

由于缺少 Info.plist,xcarchive 格式错误

[英]xcarchive malformed due to missing Info.plist

I have two project which I build based on the same Rake script, which internally uses XCode build.我有两个基于相同 Rake 脚本构建的项目,该脚本在内部使用 XCode 构建。 Building it with xcodebuild -archivePath (ARCHIVE succeeds), then I package app with xcodebuild -exportArchive .与IT建设xcodebuild -archivePath (ARCHIVE成功),然后我用打包应用xcodebuild -exportArchive The problem is that first project succeeds all steps, but second is failing on xcodebuild -exportArchive because xcarchive is malformed.问题是第一个项目所有步骤都成功,但第二个项目在xcodebuild -exportArchive上失败,因为xcarchive格式错误。 I have compared these two archives and malformation is caused by missing Info.plist inside archive.我已经比较了这两个档案,畸形是由档案中缺少Info.plist引起的。 When I prepared manually such Info.plist and put it into xcarchive , then I was able to package app without problems.当我手动准备这样的Info.plist并将其放入xcarchive ,我就可以毫无问题地打包应用程序。

Any clues why XCode build doesn't produce Info.plist inside xcarchive file?为什么 XCode 构建不会在xcarchive文件中生成Info.plist任何线索?

@diidu's comment to this questions was the solution to my problem, that I believe was the same as @Fishman's. @diidu 对这个问题的评论是我问题的解决方案,我认为这与 @Fishman 的相同。 Adding CONFIGURATION_BUILD_DIR (and removing use of SYMROOT) from my build scripts caused the Info.plist to be written in the archive, and then export succeeded.从我的构建脚本中添加 CONFIGURATION_BUILD_DIR(并删除 SYMROOT 的使用)导致 Info.plist 被写入存档,然后导出成功。

I've got this bug in an iOS application projects too.我在iOS应用程序项目中也有这个错误。 This project was using a GIT submodule linked to a framework, integrated to the Xcode workspace as a subproject.该项目使用链接到框架的 GIT 子模块,作为子项目集成到Xcode工作区。

The project did build normally until the framework submodule upgrade to use XCFramework instead of a plain framework.该项目确实正常构建,直到框架子模块升级为使用XCFramework而不是普通框架。 Digging into this problem, I've finally found the problem: the BUILD_LIBRARY_FOR_DISTRIBUTION and SKIP_INSTALL framework Build Settings !深入研究这个问题,我终于找到了问题所在: BUILD_LIBRARY_FOR_DISTRIBUTIONSKIP_INSTALL框架构建设置

If you set如果你设置

BUILD_LIBRARY_FOR_DISTRIBUTION=YES BUILD_LIBRARY_FOR_DISTRIBUTION=YES
SKIP_INSTALL=NO跳过_安装=否

to build the framework, the application archive task will generate a bad XCArchive , leaving it's Info.plist without the ApplicationProperties entry.为了构建框架,应用程序归档任务将生成一个错误的XCArchive ,使其Info.plist没有ApplicationProperties条目。 You must make sure at least no BUILD_LIBRARY_FOR_DISTRIBUTION build properties are set to YES , and probably no SKIP_INSTALL are set to NO .您必须确保至少没有BUILD_LIBRARY_FOR_DISTRIBUTION构建属性设置为YES ,并且可能没有SKIP_INSTALL设置为NO

In my case I was including via SPM, an XCFramework that had dSym/BCSymbolmap files included.就我而言,我通过 SPM 包含了一个包含 dSym/BCSymbolmap 文件的 XCFramework。

That caused the missing Info.plist to happen on a complex project, where it did not happen on a simpler one, and only when using provisioning profiles for the App Store, not enterprise profiles.这导致缺少 Info.plist 发生在一个复杂的项目上,它不会发生在一个更简单的项目上,并且仅在使用 App Store 的配置文件时,而不是企业配置文件。 It also happened when simply running Archive in Xcode, after completion the Organizer did not open because the .xcarchive generated was missing an Info.plist file at root.在 Xcode 中简单地运行 Archive 时也会发生这种情况,完成后管理器没有打开,因为生成的 .xcarchive 缺少根目录下的 Info.plist 文件。

Altering the SPM acquired XCFramework (the vendor changed it and issued a new version) to only include the framework binaries and none of the debugging info had the Archive working correctly again.改变 SPM 获得的 XCFramework(供应商对其进行了更改并发布了新版本)以仅包含框架二进制文件,并且没有任何调试信息使存档再次正常工作。

This was with Xcode 12.4, there is some reason to think Xcode 12.5 (or eventually Xcode 13) might fare better though I was not able to verify in this case.这是 Xcode 12.4,有一些理由认为 Xcode 12.5(或最终 Xcode 13)可能会更好,尽管我无法在这种情况下进行验证。

Note this occurred even after adding a fix to remove a duplicate Framework included by the Archive process in the App Plugins directory was in the manner suggested by the 12.4 release notes.请注意,即使按照 12.4 发行说明建议的方式添加修复程序以删除 App Plugins 目录中存档进程包含的重复框架,也会发生这种情况。

My issue was caused by updating 3rd party library to newer version.我的问题是由于将3rd 方库更新到较新版本引起的。 Not sure what caused it on their side but you might try to see if you haven't updated some dependencies before this started happening.不确定是什么原因导致了他们,但您可能会尝试查看在这种情况开始发生之前您是否没有更新某些依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM