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

前端 未结 9 1147
隐瞒了意图╮
隐瞒了意图╮ 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:17

    For xcode7 add "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" to your Header Search Paths (and you may need to set Enable Bitcode to No - was necessary for me, but may be related to different problem with xc7)

    0 讨论(0)
  • 2020-12-05 03:21

    Change your header file to:

    #import <Cordova/CDVPlugin.h>

    it is working in my application.

    0 讨论(0)
  • 2020-12-05 03:21

    replace

    import

    with (

    import "Classes/CDVPlugin.h"

    OR

    import "CordovaLib/Classes/CDVPlugin.h")

    0 讨论(0)
  • 2020-12-05 03:34

    I had this issue using Cordova. Come to find out my CordovaLib folder under the ios platform directory vanished.

    I did:

    cordova platform remove ios
    

    then

    cordova platform add ios
    

    ...and this fixed the issue.

    0 讨论(0)
  • 2020-12-05 03:35

    In xcode 8 and 8 + simply commenting the line worked for me:

    #import ...
    

    This is specifically useful if you are trying to extend IOS app build using ionic or cordova to have watchkit or widget control natively.

    0 讨论(0)
  • 2020-12-05 03:38

    Have a look at my answer here:

    I had the same problem while installing the ShareKit plugin on Xcode 4.5, cordova 2.1.0 & JQM 1.2.0. The problematic block was:

    #ifdef CORDOVA_FRAMEWORK
    #import <Cordova/CDVPlugin.h>
    #import <Cordova/CDVPluginResult.h>
    //#import <Cordova/JSONKit.h>
    
    #else
    #import "CDVPlugin.h"
    #import "CDVPluginResult.h"
    #import "JSONKit.h"
    #endif
    

    What worked for me is commenting out the #ifdef line as well as commenting out the whole #else block.

    Also, the #import line was already commented out in the source code that I downloaded with the plugin, so I didn't bother messing with that.

    Might be of some help to you.

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