Xcode 7.2 Failed to import bridging header

送分小仙女□ 提交于 2019-12-12 00:37:41

问题


I have a new configuration(Duplicate of debug) which is showing the error "Failed to import bridging header". But the debug configuration is compiling and running without fail. Following are the details

  • Xcode 7.2
  • iOS SDK 9.2
  • Cordova pluggins in Objective C
  • Native application code is swift 2.x
  • One target
  • Three configurations debug,test(duplicate of debug) and release.

While building the project in Debug/Release configuration no errors and running the app in simulator without any issue.

When I build configurations TestDebug(duplicate of Debug) or TestRelease(duplicate of Release) there are two errors

/Users/ ..../MainViewController.h:11:9: 'Cordova/CDVViewController.h' file not found

Failed to import bridging header '/Users/......./Example4-Bridging-Header.h'


回答1:


You need to add these Configurations (TestDebug, TestRelease) to the Cordova project as well Otherwise your main project will look in the folders for TestRelease and TestRelease but won't find the Cordova build results there By Default Cordova puts build result in Debug-iphoneos and Release-iphoneos

I had a similar issue when I added a custom Distribution to my project. For me it worked when building, but failed at archiving. Adding the custom Distribution to Cordova helped

After a clean and build you should see the Cordova lib and include in TestDebug-iphoneos or TestRelease-iphoneos and not in Release-iphoneos or Debug-iphoneos( where I guess it adds it now for you)




回答2:


Answer for future reference: "Clean" your product



来源:https://stackoverflow.com/questions/35642866/xcode-7-2-failed-to-import-bridging-header

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!