2

试着在这里尽可能地香草:

New Project->OS X->Application->Language (Swift) Name (MailCoreTest) Close project 将 Cartfile 添加到项目的根目录,其中包含一行: github "MailCore/mailcore2" 运行 carthage update --platform macosx 从项目的根 收到一些警告但没有真正的问题:

/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]

在 Xcode 中再次打开项目 在应用程序目标的“General”设置选项卡上,在“Embedded Binaries”部分,我拖放 Carthage 构建的 MailCore.framework。我还将 dSYM 添加到产品目录复制文件阶段在此阶段应用程序构建成功,但是当我添加时:

#import <MailCore/MailCore.h>
#import <MailCore/MCOConstants.h>

到 Swift-Bridging-Header.h 文件并将其添加到 Objective-C 桥接头构建设置中,我收到大量构建错误:

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'

奇怪的是我在另一个项目中工作。我什至可以针对它运行 carthage update 并且没有任何问题。经过数小时尝试重现一个有效的新项目后,我似乎无法让它工作。我一定错过了一些东西,但我无法弄清楚它是什么,甚至不知道在哪里看。

就在测试中,我尝试了“目标”下的构建设置,并将“允许框架模块中的非模块化包含”设置为“是”,但得到了相同的结果——在另一个工作项目中,我将其设置为“否”。

4

1 回答 1

3

Carthage 需要检查最新的提交。将购物车文件更改为:

github "MailCore/mailcore2" "master"

做了魔术

于 2016-05-04T16:40:17.613 回答