19

I have a problem uploading my application into the Store via Xcode, this one in particular.

Invalid Bundle contains disallowed file frameworks

I saw a lot of post about this error, but all are talking about Extension App, that I do not use.

I'm using a Custom framework and Cocoapods.

You can see here my tree :

Tree Xcode Project Custom Framework

  • XXX is my project app name
  • SharedXXX is my custom framework
  • Pods is the project created by cocoa pods

Here is my cocoa podFile :

use_frameworks!
link_with 'XXX', 'SharedXXX'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'


workspace 'XXX'

xcodeproj 'XXX/XXX.xcodeproj'
xcodeproj 'Shared/SharedXXX.xcodeproj'

def default_pods
    pod 'Reveal-iOS-SDK', :configurations => ['Debug']
    pod "SnapKit", '~> 0.17.0'
    pod "DKChainableAnimationKit", '~> 1.6.0'
    pod "AsyncSwift"
end

def shared_pods
    pod "Alamofire", '~> 3.0'
    pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
    pod 'ReachabilitySwift', :git => 'https://github.com/ashleymills/Reachability.swift'
end

target :XXX do
    xcodeproj 'XXX/XXX.xcodeproj'
    default_pods
    shared_pods
end

target :XXXDev do
    xcodeproj 'XXX/XXX.xcodeproj'
    default_pods
    shared_pods
end

target :SharedXXX do
    xcodeproj 'Shared/SharedXXXX.xcodeproj'
    shared_pods
end

Build settings for custom framework (SharedXXX) :

Custom Framework build settings

I set the Embedded property to Yes

General Settings for custom framework (SharedXXX) :

Custom Framework General Settings

The framework provided by Cocoapods is linked.

And to finish,

The General Settings to the main project (App Project : called XXX on the tree)

Main project:

Any idea ?

Kevin Machado
  • 4,141
  • 3
  • 29
  • 54
  • From the error message it looks like SharedXXX.frameworks itself contains a file named "frameworks". Apparently apple doesn't like that. Check and see if there is a file by that name. If not then make sure framework isn't referenced twice by mistake. If all else fails google the error code – Sam B Mar 02 '16 at 14:05
  • I already googled the error code, but all talk about `Embedded Swift` property.. I don't have file named 'Frameworks' on my project.. Can it be a file from Cocoapods ? – Kevin Machado Mar 02 '16 at 14:34
  • See my answer here - http://stackoverflow.com/questions/29608264/error-itms-90451-cfbundleidentifier-collision-error/40396491#40396491 – Vijay Sharma Nov 03 '16 at 08:10

2 Answers2

40

I solved the problem

Firstly, set into Build Settings

  • For main project (here XXX) : Embedded Content Contains Swift Code to YES

  • Custom Framework (SharedXXX) : Embedded Content Contains Swift Code to NO

  • Custom Framework (SharedXXX) : Runpath Search Path = @executable_path/../../Frameworks

This helped me solving that issue

Kevin Machado
  • 4,141
  • 3
  • 29
  • 54
  • After setting the Embedded Content Contains Swift Code to NO for Custom Framework not possible to install the app using the TestFlight. The app Successfully uploaded on the iTunes but when download from the TestFlight after 80% download the message comes Unable to Download App. – Hardik Patel Oct 04 '16 at 12:16
  • Setting Embedded Content Contains Swift Code to NO in my framework target resolved the problem. – arango_86 May 21 '19 at 15:53
16

I faced the same problem while trying to upload from Xcode 9.3 This happened because I added 'use_frameworks' in my OneSignal NotificationServiceExtension

enter image description here

The value Always Embed Swift Standard Libraries found in Build Settings should be set to Yes only for you main Projects and not for your custom frameworks or extensions.

varun kalra
  • 213
  • 2
  • 7
  • 2
    Had the exact same issue with Xcode 10. If you look into the path that is mentioned in the error `XXX.app/Frameworks/YYY.framework` you can find that culprit `Frameworks` folder which will contain the duplication of all Swift standard libraries! Setting *Always Embed Swift Standard Libraries* to *Yes* fixes exactly that. – roxanneM Nov 14 '19 at 12:07
  • Thanks, @roxanneM! You should post this as an independent solution! – Native_Mobile_Arch_Dev Apr 30 '20 at 19:32
  • @roxanneM, likewise thank you. This is what solved it for me. I had a Flutter project with various plugins. My Xcode project had the main Runner target and another OneSignalNotificationExtension target. I set the latter's "Always Embed Swift Standard Libraries" to No and left the main Runner's set to yes, and was able to upload to the store without the OP's error. – pilcrowpipe Jul 08 '20 at 16:15
  • I am not using XCode or have a Mac to do this; I am trying to use a CI pipeline (Codemagic) to build, and the build goes through on Codemagic, but I get the same error that this SO post discusses. If I search, I find `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;` in the `project.pbxproj`, but nothing else relating to OneSignal (that we also use). If I use a simple text editor (VS Code), how can I set it up as described above, to get this error to go away? =) – Ted Jan 18 '22 at 06:30