Validation Error: The bundle contains disallowed file 'Frameworks'

我们两清 提交于 2019-12-01 02:34:42

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.

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.

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

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

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 :

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!