Added unit testing target to Xcode - failed to import bridging header won't go away

前端 未结 5 1220
轻奢々
轻奢々 2020-12-13 23:47

I added a new Test target to my Xcode project. My project has Swift code and Objective-C code, and has a bridging header. Upon either adding the bridging header to UnitTesti

5条回答
  •  一向
    一向 (楼主)
    2020-12-14 00:44

    I faced the same problem. I did the following and the issue of 'Failed to import bridging header' is solved.

    Steps:

    1. Select your project -> Build settings -> Search for 'Defines module' -> give 'YES'
    2. Copy Objective-C bridging header path
    3. Select your test target -> Build setting -> Swift compiler - General -> Objective-C bridging header -> Give Bridging header path.
    4. Make sure 'Header Search Paths' of test targets contains all the headers in ios Targets. Add them if any of the headers are missing.
    5. Build.

    Reference: Refer this link.

提交回复
热议问题