Xcode 7.3.1 出现“无效的 Swift 支持 - 缺少 SwiftSupport 文件夹”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38981628/
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 09:08:49  来源:igfitidea点击:

"Invalid Swift Support - The SwiftSupport folder is missing" with Xcode 7.3.1

iosswiftxcodexcode7app-store-connect

提问by Luke

After submitting an app update using Application Loader, I got this email from Apple:

使用 Application Loader 提交应用更新后,我收到了来自 Apple 的这封电子邮件:

We have discovered one or more issues with your recent delivery for "[App Name]". To process your delivery, the following issues must be corrected:

Invalid Swift Support - The SwiftSupport folder is missing. Rebuild your app using the current public (GM) version of Xcode and resubmit it.

Once these issues have been corrected, you can then redeliver the corrected binary.

我们发现您最近的“[App Name]”交付存在一个或多个问题。要处理您的交货,必须更正以下问题:

无效的 Swift 支持 - 缺少 SwiftSupport 文件夹。使用当前公共 (GM) 版本的 Xcode 重建您的应用程序并重新提交。

更正这些问题后,您就可以重新交付更正后的二进制文件。

I have confirmed that this binary was built with the latest Xcode GM (7.3.1), so that is not the issue. I have seen a wide variety of potential fixes for this problem online but was hoping that by giving further details somebody might be able to help me figure out the specific solution.

我已经确认这个二进制文件是用最新的 Xcode GM (7.3.1) 构建的,所以这不是问题。我在网上看到了针对此问题的各种潜在修复方法,但希望通过提供更多详细信息,有人可以帮助我找出具体的解决方案。

  • Submitted an IPA file using Application Loader 3.5 with no problems.
  • The previous version of the app does not use Swift, but this update does.
  • The "Embedded Content Contains Swift Code" build setting is set to NO. My understandingis that this should only be YESif we have a pure Objective-C target that depends on a Swift or mixed target.
  • The project uses CocoaPods, but nothing has changed in our pods for this update.
  • The previous version of the app included a WatchKit app and extension, but this update does not.
  • Inside an xcarchivegenerated with the same build, the SwiftSupportfolder is there. It contains a subfolder called iphoneoswhich contains several Apple Swift libraries like libswiftFoundation.dylib.
  • If I rename the .ipafile to .zipand unarchive it, its app package does not contain a SwiftSupportfolder, but does contain a Frameworksfolder with the same Swift dylibs.
  • 使用 Application Loader 3.5 提交了一个 IPA 文件,没有问题。
  • 该应用程序的先前版本不使用 Swift,但此更新使用。
  • “嵌入式内容包含 Swift 代码”构建设置设置为NO. 我的理解是,只有YES当我们有一个依赖 Swift 或混合目标的纯 Objective-C 目标时才应该这样做。
  • 该项目使用 CocoaPods,但在这次更新中,我们的 Pod 中没有任何变化。
  • 该应用程序的先前版本包括 WatchKit 应用程序和扩展程序,但此更新没有。
  • xcarchive使用相同构建生成的内部,SwiftSupport文件夹就在那里。它包含一个名为的子文件夹iphoneos,其中包含多个 Apple Swift 库,例如libswiftFoundation.dylib.
  • 如果我将.ipa文件重命名为并将其解压缩.zip,则其应用程序包不包含SwiftSupport文件夹,但包含Frameworks具有相同 Swift dylib的文件夹。

采纳答案by Luke

The solution here was in this answer. We needed to use the new -exportOptionsPlistflag with xcodebuildinstead of the older -exportFormatand -exportWithOriginalSigningIdentityflags. The plist just needs to have the methodkey set to app-store.

这里的解决方案是在这个答案中。我们需要使用新的-exportOptionsPlist标志和xcodebuild替代旧的-exportFormat-exportWithOriginalSigningIdentity标志。plist 只需要将method密钥设置为app-store.

回答by tsuz

The root cause of this is that the provisioning profile is ad-hoc and it doesn't create SwiftSupportdirectory in the ipa. The folder is created using app-storeas the export method, so it worked for me when I updated my provisioning profile to app-store.

其根本原因是配置文件是临时的,它不会SwiftSupport在 ipa 中创建目录。该文件夹是app-store作为导出方法创建的,因此当我将配置文件更新为app-store.

Reference

参考

回答by Soohwan Park

In my case, I just added redundant swift file to the project and it solved the problem.

就我而言,我只是在项目中添加了冗余的 swift 文件并解决了问题。

回答by Pranit

You should choose "Save for iOS App Store Deployment" instead of "Save for Ad Hoc Deployment" option at the time of creating ipa file.enter image description here

在创建 ipa 文件时,您应该选择“保存用于 iOS App Store 部署”而不是“保存用于 Ad Hoc 部署”选项。在此处输入图片说明

回答by Nitin

Use this https://github.com/ndpiparava/Swift_StripArm64escript file remove arm64e from .app file

使用这个https://github.com/ndpiparava/Swift_StripArm64e脚本文件从 .app 文件中删除 arm64e

..Nitin

..尼丁