24

After archiving and uploading my app (using Xcode 7.2.1) to iTunes Connect I receive an email from iTunes Connect saying:

Invalid Swift Support - The Watch OS application has Swift libraries at both /Payload/Today's Menu.app/TodaysReactiveMenuWatch.app/TodaysReactiveMenuWatch Extension.appex/Frameworks/ and /Payload/Today's Menu.app/TodaysReactiveMenuWatch.app/Frameworks/. Remove all of the Swift libraries from one of the locations and resubmit your app.

My project contains an iOS app as well as a watchOS app. All targets has the flag "Embedded Content Contains Swift Code" set to YES as all of my source files are written Swift.

My pod file has the following content:

use_frameworks!

# ignore all warnings from all pods
inhibit_all_warnings!

def shared_pods
    pod 'ReactiveCocoa', '4.0.1'
    pod 'Alamofire', '~> 3.1.4'
    pod 'Unbox', '~> 1.3'
end

target 'TodaysReactiveMenu' do
    platform :ios, '9.0'

    shared_pods
    pod 'Fabric', '~> 1.6.0'
    pod 'Crashlytics', '~> 3.4.0'
    pod 'PureLayout', '~> 3.0.1'
end

target 'TodaysReactiveMenuTests' do

end

target 'TodaysReactiveMenuWatch Extension' do
    platform :watchos, '2.0'

    shared_pods
end

I'm using CocoaPods 1.0.0.beta.4. Any idea on how I fix this issue?

Seyed Parsa Neshaei
  • 3,470
  • 18
  • 30
Steffen D. Sommer
  • 2,896
  • 2
  • 24
  • 47

1 Answers1

55

I discovered that changing the "Embedded Content Contains Swift Code" from YES to NO in the Watchkit App target and setting the "Embedded Content Contains Swift Code" to Yes in the Watchkit Extension target worked for me.

PiXeL16
  • 808
  • 8
  • 5
  • I thought I tried all combinations with that setting, but apparently not. Your suggestion works! Thanks a lot. – Steffen D. Sommer Apr 04 '16 at 17:41
  • I don't see "Embedded Content Contains Swift Code" in my xcode 8 project. Is it labeled into something else? – Jay Mayu Oct 14 '16 at 06:06
  • 27
    If you are on XCode 8 then it'll be "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES" – Jay Mayu Oct 14 '16 at 06:09
  • I was confused because I had the settings as described by this answer already. I then noticed that `Embedded Content Contains Swift Code` was set for the watch extension under `User-Defined` settings (scroll all the way to the bottom of build settings). Don't know if it was added by another dev or by an Xcode migration. Using Xcode 9, so that isn't even the right setting, but apparently it is still respected – RyanM Mar 30 '18 at 18:12