2

I'm trying to deploy a .dylib library wrapped in a framework, and I'm experiencing the following issue: 'ERROR ITMS-90206: "Invalid Bundle. The bundle at X.app/Frameworks/PoemsRecommender.framework' contains disallowed file 'Frameworks'."

It looks like there's a framework nested in a framework: shared

Things I tried:

  • Remove "Frameworks" folder in the "Run Script" phase (it actually helps with submission but the app crashes because it can't find the dylib which is in the Frameworks folder)
  • Change "Frameworks" to "Shared Frameworks" in "Embed Frameworks"
  • Disable "Always Embed Swift.."
David
  • 125
  • 2
  • 15
  • Please post the whole error message without `...`. – Eugene Dudnyk Feb 09 '20 at 12:01
  • ERROR ITMS-90206: "Invalid Bundle. The bundle at X.app/Frameworks/PoemsRecommender.framework' contains disallowed file 'Frameworks'." – David Feb 09 '20 at 19:00
  • Why do you need to embed the dylib's framework into another framework? The app will perfectly link to two frameworks deployed together into `X.app/Frameworks` folder under names `X.app/Frameworks/PoemsRecommender.framework` and `X.app/Frameworks/PoemsRecommenderDylib.framework` – Eugene Dudnyk Feb 11 '20 at 22:59

1 Answers1

2

Reason

The error message indicates that you are trying to package a framework that has its own frameworks embedded inside.

This is not currently supported through traditional framework embedding

The fix is, unfortunately, to link all frameworks separately in your main target.

How do I know?

When you see this error X.app/Frameworks/PoemsRecommender.framework contains disallowed file 'Frameworks'."

Apple is explicitly saying that a framework that embeds a "Frameworks" folder is disallowed. There is a great discussion here that goes into a lot more detail.

Recommended Solution

Package your frameworks separately and link them all manually. Apple has good guidelines here

Not Recommended but will achieve your goal

If you must use a single framework, there is quite a bit of work involved. Effectively you want to create an Umbrella framework that will mask all underlying frameworks. This can get messy if you ever decide to link those sub-frameworks in other parts of your application. Since your question is vague on the details I cannot ascertain if this will affect you.

There are a number of resources that can guide you through the laborious process.

Effectively the steps involve creating an aggregate target that can use a build script to bind all your frameworks at runtime.

I have done this in the past and we ran into lots of issues on the way and I would not recommend this approach. In the past we had a white-labelled SDK that consisted of a number of internal frameworks that were binded by an aggregate target. More often than not it was difficult to maintain and difficult to understand by new team members. Eventually we just migrated to multiple frameworks.

I think Apple has their own tooling to support how they do it but, sadly, it is not available to us peasants.

Daniel Galasko
  • 23,617
  • 8
  • 77
  • 97
  • Daniel, thank you so much for a very detailed answer. What I'm trying to accomplish is to use a library packaged as a dylib. But it can't be included directly (unfortunately), it has to be packaged as a framework.I'm following directions in the "Recommended Solution" but still getting the same error. Here is an empty project I created with a setup similar to mine: https://www.dropbox.com/s/0hl19wnm15g668q/RecommenderSample.zip?dl=0 If you could take a look at it I'd be really grateful – David Feb 11 '20 at 21:25
  • 2
    @David I just got it working. The same advice follows. The dylib must be set as "Do not embed" in your framework target. Then, the main App target must also link against the dylib under the Frameworks, libraries and embedded content section. I managed to get a successful archive without two framework folders. Since your example has no code usage I could not validate it actually runs but let me know! – Daniel Galasko Feb 12 '20 at 12:06
  • I've just tried, got past the upload process, but a few minutes later received an email with the following error: https://imgur.com/snAQL2v – David Feb 12 '20 at 21:55
  • It seems you can't have any dylibs in the Frameworks, libraries and embedded content section. Which is sad because that's how Apple ships its recommender library.. (https://apple.github.io/turicreate/docs/userguide/recommender/coreml-deployment.html) – David Feb 12 '20 at 21:57
  • @David that seems to be a different error though? Have you searched the web about it? ie https://stackoverflow.com/questions/38981628/invalid-swift-support-the-swiftsupport-folder-is-missing-with-xcode-7-3-1 – Daniel Galasko Feb 13 '20 at 10:03
  • I have but I’m still getting this (new) error :( I‘ve just remembered I can use one technical support ticket from Apple this year so I’ll try contacting them - if I manage to find a solution I’ll post it here. Anyway thank you a lot – David Feb 14 '20 at 22:57