2016-07-17 44 views
3

试图ParseLiveQuery cocoapod融入我的项目,但建设我不断收到错误时:包括框架模块错误内非模块化头的

Include of non-modular header inside framework module error 'Bolt.BFCancellation'

enter image description here

我安装ParseLiveQuery (连同Parse)通过cocoapods。这里是我的podfile:

use_frameworks! 

pod 'ParseLiveQuery' 
pod 'Parse' 

post_install do |installer| 
    installer.pods_project.build_configuration_list.build_configurations.each do |configuration| 
    configuration.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES' 
    end 
end 

我还设置允许非模块在构建设置包括框架模块,但仍获得此错误。

回答

5

刚刚碰到了这个自己。我将头文件添加到框架的伞头,然后将其作为Public添加到Headers部分。 (我添加可达LIB)

enter image description here

到目前为止,这似乎是为我工作无故障。

+0

在这种情况下,可达性将在框架外部可见。但我不希望这些可达性类被暴露,我该怎么做? - – User9527

+0

我不得不想一点,但它真的很重要吗?可达性是一个“公共”图书馆,那么通过图书馆“可用”的缺点是什么? – Nick

+1

是的,这很重要。由于我的框架中有很多OC代码。我不希望我的框架的用户看到这些OC代码。无论如何,我发现了另一种解决方案:使用这样的模块:https://stackoverflow.com/questions/42085217/swift-project-missing-required-modules-when-import-a-modular-framework – User9527