xcode 验证错误:捆绑包包含不允许的文件“框架”

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

Validation Error: The bundle contains disallowed file 'Frameworks'

iosobjective-cxcodevalidationapp-store-connect

提问by Aaron Vegh

I'm having the same issue as this guy, this guy, and this guy(nota bene, I'm actually not sure if they're all guys, per se).

我和这个人这个人和这个人有同样的问题(nota bene,我实际上不确定他们是否都是人,本身)。

They all ended up finding their own solutions, but none of them apply to my issue. I'm using Xcode 6.1 in my iOS 8 app with an included extension. The app and the extension both rely on an included framework. When I try to submit the app to the Store, the validation warning I get is "ERROR ITMS-9000: Invalid bundle. The bundle at 'xxxxx.appex' contains disallowed file 'Frameworks'".

他们最终都找到了自己的解决方案,但没有一个适用于我的问题。我在我的 iOS 8 应用程序中使用 Xcode 6.1,其中包含一个扩展。应用程序和扩展程序都依赖于一个包含的框架。当我尝试将应用程序提交到商店时,我收到的验证警告是"ERROR ITMS-9000: Invalid bundle. The bundle at 'xxxxx.appex' contains disallowed file 'Frameworks'".

I can't even find a file called Frameworks. The shared framework is supposed to be saved at /Library/Frameworks, which is Apple's recommended save location. The project also uses Cocoapods, which strikes me as the only other possible culprit, since it has references in its configuration files to $FRAMEWORK_PATH (though the build folder doesn't include a file or folder with that name).

我什至找不到名为 Frameworks 的文件。共享框架应该保存在/Library/Frameworks,这是Apple 推荐的保存位置。该项目还使用 Cocoapods,这让我觉得它是唯一可能的罪魁祸首,因为它在其配置文件中引用了 $FRAMEWORK_PATH(尽管构建文件夹不包含具有该名称的文件或文件夹)。

回答by Rob Sanders

OK for future viewers here's the fix:

对于未来的观众来说,这里是修复:

When you create your own iOS framework (I'm using Xcode 6.1) when you build it the final product contains a 'Frameworks' folder in the framework bundle itself. i.e. MyFramework.framework/Frameworks. This happens even if you don't specify a copy files/embed frameworks build phase.

当您创建自己的 iOS 框架(我使用的是 Xcode 6.1)时,最终产品在框架包本身中包含一个“Frameworks”文件夹。即 MyFramework.framework/Frameworks。即使您没有指定复制文件/嵌入框架构建阶段,也会发生这种情况。

What you have to do is to go into you framework bundle, find the empty frameworks folder and delete it. This should not affect your app's functionality in any way. Then build your app and check that the embedded framework doesn't have a Frameworks folder as planned.

您需要做的是进入您的框架包,找到空的框架文件夹并将其删除。这不应以任何方式影响您的应用程序的功能。然后构建您的应用程序并检查嵌入式框架是否没有计划中的 Frameworks 文件夹。

Your archive should now not contain the offending folder and the error should be gone!

您的存档现在不应该包含有问题的文件夹,错误应该消失了!

回答by David T.

I changed build settings > Packaging > Define modules set to YES in my extension and watch app target. Works fine for me.

我在我的扩展程序中更改了构建设置 > 打包 > 定义模块设置为 YES 并观看应用程序目标。对我来说很好用。

回答by Victor Sigler

In my case the solution was the following :

在我的情况下,解决方案如下:

Try to create the script there 'problematic target' -> Build Phases' then click on +and select New Run Script Phase, the run script should go after all others. Insert there :

尝试在“有问题的目标”->“构建阶段”中创建脚本,然后单击+并选择New Run Script Phase,运行脚本应该在所有其他脚本之后运行。在那里插入:

cd "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/"
if [[ -d "Frameworks" ]]; then 
   rm -fr Frameworks
fi

Then clean the project and try to create an archive once again. These answer was provided in the following issue :

然后清理项目并再次尝试创建存档。这些答案在以下问题中提供:

I hope this help you.

我希望这对你有帮助。

回答by Aaron Vegh

Continuing to work with this, I noted that my Share Extension had an "Embed Frameworks" Build Phase, with the Destination set to the "Frameworks" directory. I changed it to "Shared Frameworks" and the error has gone away.

继续使用它,我注意到我的共享扩展有一个“嵌入框架”构建阶段,目标设置为“框架”目录。我将其更改为“共享框架”,错误消失了。

However, another error remains: "... contains disallowed nested bundles". I thought this was a sort of umbrella error warning as a result of the original. I'll open another question for that one.

但是,另一个错误仍然存​​在:“...包含不允许的嵌套包”。我认为这是原版的一种伞形错误警告。我将为那个问题打开另一个问题。