I\'m currently using Phonegap 2.0 to develop an iOS App in XCode. The app builds and runs fine in the emulator and also on the testing devices.
The problem appears w
As is sometimes the case, an accepted solution may not help everyone with a similar but perhaps unrelated issue.
My observation was similar (CDVViewController.h not found). First ensure the TARGET settings includes "header search paths" as described above.
Then follow this link to what worked for me: http://outof.me/embedding-cordovalib-in-your-iosphonegap-app-project/
Essentially I needed to re-link cordova as a target dependency and then Link it to my libraries.
THEN, If you migrated to cordova 2.5.0, you will likely run into an issue that spits out something similar to this: ""_ALAssetPropertyDate", referenced from:
___23-[CDVFile getMetadata:]_block_invoke in libCordova.a(CDVFile.o)
___27-[CDVFile getFileMetadata:]_block_invoke in libCordova.a(CDVFile.o)
"_OBJC_CLASS_$_ALAssetsLibrary", referenced from:
objc-class-ref in libCordova.a(CDVFile.o)
objc-class-ref in libCordova.a(CDVFileTransfer.o)
objc-class-ref in libCordova.a(CDVURLProtocol.o)
"
If os, add the AssetLibrary framework and have some peace.
You may need to update your CordovaLib sub-project reference.
Launch Terminal
Go to the location where you installed Cordova in the bin sub-folder. For example, /Users/Shared/Cordova/phonegap-2.2.0/lib/ios/bin
Run the command below where the first parameter is the path to your project's .xcodeproj file:
./update_cordova_subproject /path/to/your/project
I was experiencing the exact same problem. I believe it may have been introduced because I moved the location of the Xcode project after I created it with Cordova's tools. Or, it may also be possible that I didn't properly setup the Cordova iOS toolset - perhaps I didn't run the installer package (I've rebuilt this machine a couple of times). Also, all the related answers I found with Google suggested I needed to change some of Cordova's core classes - which I wasn't willing to do.
My solution was to use the Cordova create
command to build an entirely new Xcode project. I copied my original project's www
directory into the new project and then went about re-configuring the new project to match the settings of the original project.
The new project, using the same plugins, frameworks and build settings successfully built an archive whereas the original project could not. It's not an ideal solution - but it worked.
On Xcode 7.1, you would need to update header search paths
field from $(OBJROOT)/UninstalledProducts/include
to $(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include
You can find header search paths
under build settings
-> search paths