Trying to be as vanilla as I can here:
New Project->OS X->Application->Language (Swift) Name (MailCoreTest) Close project Add a Cartfile to the project’s root with a single line in it: github "MailCore/mailcore2" Run carthage update --platform macosx from the project’s root Get a couple of warnings but no real problems:
/Users/theuser/Documents/XCode/MailCoreTest/Carthage/Checkouts/mailcore2/src/async/imap/MCIMAPAsyncSession.cpp:793:66: warning: 'gmailUserDisplayName' is deprecated [-Wdeprecated-declarations]
/Users/theuser/Documents/XCode/MailCoreTest/Carthage/Checkouts/mailcore2/src/async/imap/MCIMAPAsyncSession.cpp:793:66: warning: 'gmailUserDisplayName' is deprecated [-Wdeprecated-declarations]
Open the project again in Xcode On the application targets’ “General” settings tab, in the “Embedded Binaries” section, I drag and drop MailCore.framework which Carthage built. I also add the dSYM to a Products Directory Copy Files Phase At this stage the app builds successfully, but when I add:
#import <MailCore/MailCore.h>
#import <MailCore/MCOConstants.h>
To a Swift-Bridging-Header.h file and add it to the Objective-C Bridging Header Build Setting I get loads of build errors:
MailCoreTest Group
/Users/theuser/Documents/XCode/MailCoreTest/Carthage/Build/Mac/MailCore.framework/Headers/MCIndexSet.h
/Users/theuser/Documents/XCode/MailCoreTest/Carthage/Build/Mac/MailCore.framework/Headers/MCIndexSet.h:15:10: Include of non-modular header inside framework module 'MailCore.MCIndexSet'
/Users/theuser/Documents/XCode/MailCoreTest/<module-includes>
/Users/theuser/Documents/XCode/MailCoreTest/<module-includes>:1:1: Umbrella header for module 'MailCore' does not include header 'MCIMAPConnectOperation.h'
/Users/theuser/Documents/XCode/MailCoreTest/<module-includes>:1:1: Umbrella header for module 'MailCore' does not include header 'MCIMAPNoopOperation.h'
/Users/theuser/Documents/XCode/MailCoreTest/<module-includes>:1:1: Umbrella header for module 'MailCore' does not include header 'MCMainThread.h'
/Users/theuser/Documents/XCode/MailCoreTest/<module-includes>:1:1: Umbrella header for module 'MailCore' does not include header 'MCMXRecordResolverOperation.h'
/Users/theuser/Documents/XCode/MailCoreTest/<module-includes>:1:1: Umbrella header for module 'MailCore' does not include header 'MCNNTPCheckAccountOperation.h'
/Users/theuser/Documents/XCode/MailCoreTest/<module-includes>:1:1: Umbrella header for module 'MailCore' does not include header 'MCONNTPDisconnectOperation.h'
/Users/theuser/Documents/XCode/MailCoreTest/<module-includes>:1:1: Umbrella header for module 'MailCore' does not include header 'MCOPOPNoopOperation.h'
/Users/theuser/Documents/XCode/MailCoreTest/<module-includes>:1:1: Umbrella header for module 'MailCore' does not include header 'MCOSMTPLoginOperation.h'
/Users/theuser/Documents/XCode/MailCoreTest/<module-includes>:1:1: Umbrella header for module 'MailCore' does not include header 'MCPOPNoopOperation.h'
/Users/theuser/Documents/XCode/MailCoreTest/<module-includes>:1:1: Umbrella header for module 'MailCore' does not include header 'MCSizeFormatter.h'
/Users/theuser/Documents/XCode/MailCoreTest/<module-includes>:1:1: Umbrella header for module 'MailCore' does not include header 'MCSMTPNoopOperation.h'
/Users/theuser/Documents/XCode/MailCoreTest/MailCoreTest/Swift-Bridging-Header.h
/Users/theuser/Documents/XCode/MailCoreTest/MailCoreTest/Swift-Bridging-Header.h:12:9: Could not build module 'MailCore'
Failed to import bridging header '/Users/theuser/Documents/XCode/MailCoreTest/MailCoreTest/Swift-Bridging-Header.h'
The strange thing is I have this working in another project. I can even run carthage update against it and nothing breaks. After hours of trying to reproduce a working new project I cannot seem to get it to work. I must be missing something but I cannot figure out what it is or even where to look.
Just in testing I tried Build Settings under "Target" and set "Allow Non-modular Includes in Framework Modules" to YES but get the same result -- and in the other working project I have this is set to NO.
Need for Carthage to checkout the latest commit. Changing the Cartfile to:
github "MailCore/mailcore2" "master"
Did magic