ios 验证错误:无效的捆绑包。位于 ... 的包包含不允许的文件“Frameworks”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25777958/
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
Validation Error: Invalid Bundle. The bundle at ... contains disallowed file 'Frameworks'
提问by Mike
I'm trying to submit an app with the Xcode6 GM, and I get this error on validation. The app has an action extension and a dynamic framework that's shared between the extension and the app itself.
我正在尝试使用 Xcode6 GM 提交应用程序,但在验证时出现此错误。该应用程序具有一个操作扩展程序和一个在扩展程序和应用程序本身之间共享的动态框架。
I don't have a file called 'Frameworks' anywhere in the project, so I'm really not sure what this is supposed to mean. Has anyone gotten this issue or have any ideas?
我在项目的任何地方都没有名为“Frameworks”的文件,所以我真的不确定这应该是什么意思。有没有人遇到过这个问题或有任何想法?
回答by Mike
Turns out the error is related to using Swift (both the app and the extension make use of Swift).
原来错误与使用 Swift 相关(应用程序和扩展都使用 Swift)。
For the app, I had to set:
对于应用程序,我必须设置:
Embedded Content Contains Swift Code: YES
and for the extension:
和扩展:
Embedded Content Contains Swift Code: NO
Xcode 8 and 9
Xcode 8 和 9
Looks like this has been renamed to Always Embed Swift Standard Libraries
in Xcode 8 and 9. So, for the app:
看起来这已Always Embed Swift Standard Libraries
在 Xcode 8 和 9 中重命名。因此,对于应用程序:
Always Embed Swift Standard Libraries: YES
and for the extension:
和扩展:
Always Embed Swift Standard Libraries: NO
回答by Roman
The only solution that worked for me was to add this Run Script to the App Extension target:
唯一对我有用的解决方案是将此运行脚本添加到 App Extension 目标:
cd "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/"
if [[ -d "Frameworks" ]]; then
rm -fr Frameworks
fi
回答by Vincent Song
So 3 steps to fix this from build settings
因此,从构建设置中解决此问题的 3 个步骤
- Container App:
Embedded Content Contains Swift Code: YES
- Extension:
Embedded Content Contains Swift Code: NO
- Extension: Runpath Search Path =
@executable_path/../../Frameworks
- 容器应用:
Embedded Content Contains Swift Code: YES
- 延期:
Embedded Content Contains Swift Code: NO
- 扩展名:运行路径搜索路径 =
@executable_path/../../Frameworks
回答by Dan Loughney
In my case, I just upgraded to CocoaPods 1.0.1 and this appears to be a new bug.
就我而言,我刚刚升级到 CocoaPods 1.0.1,这似乎是一个新错误。
The Pod update adds a run script to my Extension's target which creates the Frameworks folder. I found it as I was about to add @Roman's run script to remove it.
Pod 更新将运行脚本添加到我的扩展的目标,该目标创建 Frameworks 文件夹。我发现它是因为我要添加@Roman 的运行脚本来删除它。
Solution was to delete this script from my extension's build phase. Here is the one which needed to go...
解决方案是从我的扩展程序的构建阶段中删除此脚本。这是一个需要去的......
回答by Bart?omiej Semańczyk
Remove Every Build Phasefor your extension that has embed
word in its title.
删除标题中包含单词的扩展程序的每个构建阶段embed
。
Additionally:
此外:
- Embedded content contains Swift codemust be set to
Yes
for the extension target.
- 嵌入内容包含的 Swift 代码必须设置
Yes
为扩展目标。
回答by Max MacLeod
None of the above answers worked for me. This was because the error was caused not by the parent app or it's extension. Rather one of the linked libraries was at fault.
以上答案都不适合我。这是因为错误不是由父应用程序或其扩展引起的。相反,链接库之一有问题。
To confirm, first archive using Xcode then using Organiser select the entry and locate using Show in Finder. This will show the .xcarchive
file.
要确认,首先使用 Xcode 存档,然后使用 Organizer 选择条目并使用 Show in Finder 定位。这将显示.xcarchive
文件。
Select that file and choose "Show Package Contents".
选择该文件并选择“显示包内容”。
Select the .app in the Products/Applications folder and again choose "Show Package Contents".
在 Products/Applications 文件夹中选择 .app 并再次选择“显示包内容”。
Locate the offending module in the Frameworks folder. For example if the error is:
在 Frameworks 文件夹中找到有问题的模块。例如,如果错误是:
ERROR ITMS-90206: "Invalid Bundle. The bundle at 'MyApp.app/Frameworks/MyLib.framework' contains disallowed file 'Frameworks'."
Then in the Frameworks/MyLib.framework
the following will probably be visible:
然后在Frameworks/MyLib.framework
以下内容中可能会看到:
../Frameworks/libswiftContacts.dylib
../Frameworks/libswiftCore.dylib
../Frameworks/libswiftCoreData.dylib
../Frameworks/libswiftCoreGraphics.dylib
../Frameworks/libswiftCoreImage.dylib
../Frameworks/libswiftCoreLocation.dylib
../Frameworks/libswiftDarwin.dylib
../Frameworks/libswiftDispatch.dylib
../Frameworks/libswiftFoundation.dylib
../Frameworks/libswiftLocalAuthentication.dylib
../Frameworks/libswiftObjectiveC.dylib
../Frameworks/libswiftPassKit.dylib
../Frameworks/libswiftUIKit.dylib
../Frameworks/libswiftWebKit.dylib
These are present because the linked library - or module - that the parent app includes has the EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
这些存在是因为父应用程序包含的链接库 - 或模块 - 具有 EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
Locate the dependent module in Xcode and update the flag:
在 Xcode 中找到依赖模块并更新标志:
Note that having overcome this issue the app may still be rejected with an explanatory email from the iTunes Store:
请注意,解决此问题后,该应用程序可能仍会被拒绝,并会收到来自 iTunes Store 的解释性电子邮件:
Invalid Swift Support - The Watch OS application has Swift libraries at both...
Again this comes back to the EMBEDDED_CONTENT_CONTAINS_SWIFT
flag. Ensure that only the parent app has this set to YES
. Both the WatchKit app and extension must have this flag set to NO
. This is as detailed in @Mike's answer above.
这又回到了EMBEDDED_CONTENT_CONTAINS_SWIFT
国旗上。确保只有父应用程序将此设置为YES
。WatchKit 应用程序和扩展程序都必须将此标志设置为NO
。这在上面@Mike 的回答中有详细说明。
回答by suztomo
回答by Pim
In my case the solution was to remove my framework from my extension's Embedded Binaries and add it to my extension's Linked Frameworks and Libraries. (Both can be found in the extension's General tab.)
在我的情况下,解决方案是从我的扩展的嵌入式二进制文件中删除我的框架,并将其添加到我的扩展的链接框架和库中。(两者都可以在扩展的常规选项卡中找到。)
回答by Reeonce Zeng
If Embed Pods Frameworksscript and Roman's scriptboth exist in the same target.
如果Embed Pods Frameworks脚本和Roman 的脚本都存在于同一个目标中。
Please check if the Embed Pods Frameworks locates before the other one. If not, just move Roman's script to the last.
请检查 Embed Pods Frameworks 是否位于另一个之前。如果没有,只需将 Roman 的脚本移至最后。
回答by Gujamin
I was unable to find any settings for Embedded Content Contains Swift Code
but I was able to find a setting Always Embed Swift Standard Libraries
and setting this to NO for my framework did fix this issue.
我无法找到任何设置,Embedded Content Contains Swift Code
但我能够找到一个设置Always Embed Swift Standard Libraries
并将其设置为我的框架的 NO 确实解决了这个问题。