6

Trying to integrate ParseLiveQuery cocoapod into my project, but when building I keep getting the error:

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

enter image description here

I installed ParseLiveQuery (along with Parse) via cocoapods. Here's my 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

I have also set Allow Non-module Includes In Framework Modules to Yes in build settings, but still get this error.

vikzilla
  • 3,998
  • 6
  • 36
  • 57

2 Answers2

9

Just ran into this myself. I added the header file to the Framework's umbrella header, and then added it to the Headers section as Public. (I'm adding Reachability lib)

enter image description here

So far it seems to be working for me without trouble.

Nick
  • 2,735
  • 1
  • 29
  • 36
  • In that case, the Reachability will be visible outside of the framework. But I don'' want these Reachability class to be exposed, what should I do? – – DàChún Oct 09 '17 at 21:40
  • I'd have to think about it a bit, but does it really matter? Reachability is a "public" library, so what is the downside of having it "available" via your library? – Nick Oct 10 '17 at 14:24
  • 1
    Yes, it does matter. Since there are lots of OC codes in my framework. I don't want the users of my framework to see these OC codes. Anyway, I found an another solution: using module like this guy: https://stackoverflow.com/questions/42085217/swift-project-missing-required-modules-when-import-a-modular-framework – DàChún Oct 10 '17 at 19:11
  • @DàChún [this answer](https://stackoverflow.com/a/37072619) basically says to make a separate swift module for the Obective-C code so that the headers don’t have to be set as `Public` – TT-- Oct 27 '20 at 01:30
0

I solved it removing Modules folder from the framework.

  • Browse to your framework location which is present in the App Project using finder

  • Go inside Test.framework folder (In the above case it will be ParseLiveQuery.framework) & Delete Modules folder.

  • Clean and Re Build the app, it will solve the problem.

Vittal Pai
  • 3,317
  • 25
  • 36