“'CDVPlugin.h' file not found” in Cordova as component (Cleaver)

前端 未结 9 1174
隐瞒了意图╮
隐瞒了意图╮ 2020-12-05 03:10

I added Cordova as a component to my iOS project. Adding a custom plugin leads to the error, despite that the plugin works in a Cordova-only project:

\'CDVPl         


        
9条回答
  •  半阙折子戏
    2020-12-05 03:40

    I have spent awful lot of time trying to fix the same issue in my project, so let me share my findings. It might be relevant for those who are able to build the project in one configuration, but in another configuration (e.g. when building unit tests) precompiler fails to find CDVPlugin.h.

    You have to make sure that CordovaLib sub-project has the same set of configurations as your main project.

    1. Select the main project in Xcode in project navigator.
    2. Click on the project icon (above the Targets).
    3. Select Info tab.
    4. Expand Configurations.

    So, this is a set of your app configurations. In my example it looked like this: App configurations

    You need to have the same set of configurations in your CordovaLib sub-project.

    1. Select CordovaLib sub-project.
    2. Click on the project icon (above the Targets).
    3. Select Info tab.
    4. Expand Configurations.
    5. Make sure you have the same set of configurations as in the main project. If some configurations are missing:
      1. Click + button.
      2. Select Duplicate "Release" Configuration
      3. Give the right name for configuration. Copy-paste it from main project settings.

    Now perform a clean build.

提交回复
热议问题