Embedding a Framework Within a Framework (iOS 8+)

Embedding a framework within a framework (iOS 8+)

Found the answer. Here's how it's done:

  • Navigate to Target > Build Phases
  • Click the small "+" icon and select "New Run Script Build Phase"
  • Paste the following:

    cd $BUILT_PRODUCTS_DIR

    mkdir $PROJECT_NAME.framework/Frameworks &>/dev/null

    for framework in *.framework; do
    if [ $framework != $PROJECT_NAME.framework ]; then
    cp -r $framework $PROJECT_NAME.framework/Frameworks/ &>/dev/null
    fi
    done

Embed framework in framework

Yes; it's possible (at least with OSX Frameworks, so I assume with iOS Frameworks too).

Read the Apple Documentation about Umbrella Frameworks:

The Umbrella Framework Bundle

Physically, umbrella frameworks have a
similar structure to standard frameworks. One significant difference
is the addition of a Frameworks directory to contain the subframeworks
that make up the umbrella framework.

Embedded Frameworks iOS 8

Used a ticket to speak with Apple

"Hi Rob,

Thank you for contacting Apple Developer Technical Support (DTS). I am currently investigating your issue. To answer your question, I need to consult with some folks in iTunes Connect. Unfortunately this can take some time as they are very busy.

In the meantime, I will point out that it is only supported to use an embedded framework on iOS 8. The only question is whether you could use dlopen() to conditionally load the embedded framework on iOS 8, and not load the embedded framework on earlier versions of iOS.

I will let you know what I hear from iTunes Connect about this question.

Luke Rattei
 DTS Engineer"

"Hi Rob,

Embedded frameworks are only supported on iOS 8 and above. Unfortunately you will not be able to use an embedded framework on iOS 7.

While it might be possible to run apps with embedded frameworks on iOS 7 during development, you will not be able to submit such apps to the App Store. You will see an error message that the MinimumOSVersion of your embedded framework must be at least 8.0.

Luke Rattei
 DTS Engineer"

Add framework to Embed Frameworks Build Phase in XCode iOS 8 project using CocoaPods

I was able to solve this problem by using the the latest beta of CocoaPods.

The fix to the embedded framework problem is listed in this bug report.

Hopefully the beta will soon be released.



Related Topics



Leave a reply



Submit