no umbrella header found for target, module map will not be generated

前端 未结 5 1503
失恋的感觉
失恋的感觉 2020-12-02 20:22

When I trying build CKCountdownButton as a framework in Xcode 6.3, it complains with

warning: no umbrella header found for target \'CKCountdownButton\', mod

相关标签:
5条回答
  • 2020-12-02 20:51

    That target needs to have at least 1 Swift file. Check that you have Swift files added to the target

    0 讨论(0)
  • 2020-12-02 20:57

    Add a CKCountdownButton.h in framework fixed this issue.

    I think the umbrella header means the header file with same name like Framework

    0 讨论(0)
  • 2020-12-02 20:58

    Custom module map for a framework[About]

    Create an umbrella file - any .h file (or autogenerated <product_name>.h for Framework target)

    Add all .h files that will be open for consumer into umbrella file

    #import "header_1.h"
    #import "header_2.h"
    

    Add the umbrella file and headers files .h from it (header_1.h, header_2.h) to the Headers section[can not do it] [public target membership]

    Select `.h` file -> Select File Inspectors Tab -> Target Membership -> Select the target and make it **public**
    //or
    Project editor -> select a target -> Build Phases -> Headers -> add files to the **public** zone
    

    Create a .modulemap file

    framework module product_name {
        umbrella header "<umbrella_name>.h"
        export *
    }
    

    Check Defines Module

    Build Settings -> Defines Module -> YES
    

    Specify Module Map File

    Build Settings -> Module Map File -> relative path to `.modulemap` file 
    
    0 讨论(0)
  • 2020-12-02 21:03

    I found another solution, Xcode provides a way to specify umbrella header through Module Map File configuration.

    snapshot

    The contents of module.modulemap should be:

    framework module Foo {
        umbrella header "Bar.h"
    
        header "other-header.h"
    
        export *
        module * { export * }
    }
    
    0 讨论(0)
  • 2020-12-02 21:04

    I had the same problem with 'GoogleToolbox'. It happened when I tried to update my pod repo and some error happened. Just did 'pod install' from terminal on the project folder and everything got ok.

    0 讨论(0)
提交回复
热议问题