Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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:

'CDVPlugin.h' file not found
  • PhoneGap / Cordova 1.7.0 installed
  • Checked multiple times to correctly implement the steps https://github.com/apache/incubator-cordova-ios/blob/master/guides/How%20to%20Use%20Cordova%20as%20a%20Component.md ("Adding Cleaver to your Xcode project (CordovaLib sub-project)")
  • The Plugin works in a plain cordova-based application (Cordova Xcode template)
  • Adding "-all_load" to the 'other linker flags' in the main project does have no effect

The problematic part is as follows:

#import <Foundation/Foundation.h>

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

What am I missing?

like image 283
Michael Schmidt Avatar asked Sep 11 '25 01:09

Michael Schmidt


2 Answers

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)

like image 183
Marek Jalovec Avatar answered Sep 12 '25 16:09

Marek Jalovec


Click on the project icon in the Project Navigator,

select your Project, then select the "Build Settings" tab

Enter "Header Search Paths" in the search field

Add "$(CORDOVALIB)/Classes" and check the Recursive checkbox - for the Header Search Paths value

optional Add "-all_load" and "-Obj-C" - for the Other Linker Flags value

see detailed description (step 17)

like image 31
user513790 Avatar answered Sep 12 '25 15:09

user513790