【发布时间】:2019-01-09 21:49:45
【问题描述】:
我正在尝试发布一个 iOS swift 应用程序。我使用 Xcode 9.4.1。该应用程序包含一个共享扩展程序,用于对文件进行 HTTP 上传。共享扩展使用 SwiftHTTP。应用验证失败并出现以下错误:
Invalid Bundle. The bundle at 'FooBar.app/PlugIns/FileUploadextension.appex' contains disallowed nested bundles.
An unknown error occurred.
Invalid Bundle. The bundle at 'FooBar.app/PlugIns/FileUploadextension.appex' contains disallowed file 'Frameworks'.
An unknown error occurred.
我在 StackOverfllow 上查看了有关错误消息的其他答案。
我为扩展禁用了嵌入 swift 库:
为主应用启用嵌入:
扩展有一个框架复制步骤:
我尝试将this script 添加到扩展构建阶段:
cd "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/"
if [[ -d "Frameworks" ]]; then
rm -fr Frameworks
fi
使用此脚本后,应用程序通过了验证,但扩展程序不起作用。它失败了:
Hub connection error Error Domain=NSCocoaErrorDomain
Code=4097 "connection to service named
xxx.FooBar.FileUploadextension"
UserInfo={NSDebugDescription=connection to service named
当我在 Finder 中打开我的 FileUploadextension.appex 时,我有一个 Frameworks 目录,其中包含 SwiftHTTP.framework。如何解决问题以通过验证并使扩展程序正常工作? p>
【问题讨论】:
-
你解决了吗?我也有类似的问题,但使用其他框架。
-
我按照这个指南做了二十次,最终成功了,翻转所有的魔法开关,直到它起作用:-| developer.apple.com/library/archive/technotes/tn2435/…
-
我在使用 MBProgress 框架的 iOS 共享扩展上遇到了完全相同的问题。你搞定了吗?
-
我设法让它工作。我的答案如下。