Search code examples
iosframeworkscocoapodsbridging-headermodule-map

Custom framework cannot find other pod that required Bridging-Header file: "No such module 'InsiderMobile'"


Currently we are developing a custom framework which need to use InsiderMobile cocoapods. According to this guideline, we will need o create Bridging-Header File to use InsiderMobile. However, Bridging-Header or Umbrella file did not work inside our framework so we have to use MapModule with Build Settings/Import Paths method, then the framework compile just fine.

The actual problem occur when we try to apply our framework to an application. The framework recognize all other pods except InsiderMobile. Here our current settings:

  • We got both our custom framework and InsiderMobile in Pods folder,
  • Our custom framework is Embed,
  • MapModule with Build Settings/Import Paths method is also apply,

Here is some methods that we've already tried:

  • pod install again, delete derived data, clean and rebuild project,
  • Manually edit custom framework -umbrella file, but bump into new error: "Include of non-modular header inside framework module ", also try to set Allow Non-modular Includes In Framework Modules in Build Settings to Yes
  • Also Embed InsiderMobile framework,

None of these above methods solve the problem. Is there anyway to allow our custom framework to import InsiderMobile? Thanks in advance.


Solution

  • In case it's helpful, i have found a way to temporary solve this issue. Not the best but help us unstuck the developing process. Basically, i have been trying to work with .modulemap method the whole time, you can find the docs here. Then i found this topic, and there this guys repo. I just follow the repo with a little change on the .modulemap file and everything work fine for me. Here's my .modulemap file:

    module InsiderMobile [system] {
    // Framework complier
    // header "../../../../Pods/InsiderMobile/InsiderMobile.framework/Headers/Insider.h"
    
    //App complier
    header "../../../../../../Pods/InsiderMobile/InsiderMobile.framework/Headers/Insider.h"
    
    export *
    

    }

    Cause .modulemap file directory might change when it go remote, so i have to change to suitable path before deploy it. I know it inconvenience but it work for now.