Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap CDVViewController.h file not found when Archiving for iOS

Tags:

xcode

ios

cordova

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 when I try to archive the app for distribution. The archive fails with the following message:

CDVViewController.h file not found.

Any ideas?

like image 776
Reinaldo Avatar asked Aug 29 '12 18:08

Reinaldo


5 Answers

Xcode 6.x

add $(OBJROOT)/UninstalledProducts/include to BuildSettings->Header Search Paths

Xcode 7.x

add $(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include to BuildSettings->Header Search Paths

1.Double click the <multiple values> and you can add this in.

2.Change $(OBJROOT)/UninstalledProducts/include to $(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include

enter image description here

like image 75
Allan Avatar answered Nov 13 '22 13:11

Allan


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

like image 26
Hamid Tavakoli Avatar answered Nov 13 '22 12:11

Hamid Tavakoli


Managed to fix it.

These were missing from "Header Search Path" in the build setting of my TARGET settings:

"$(TARGET_BUILD_DIR)/usr/local/lib/include"
"$(OBJROOT)/UninstalledProducts/include"
"$(BUILT_PRODUCTS_DIR)"

Get the solution form multiple sources:

Upgrading Cordova iOS (Stepts from 31) http://docs.phonegap.com/en/2.0.0/guide_upgrading_ios_index.md.html#Upgrading%20Cordova%20iOS

Bug report https://issues.apache.org/jira/browse/CB-1122

Discussion at groups.google.com/forum/?fromgroups=#!topic/phonegap/IcR8-ijrUfk

Discussion at groups.google.com/forum/?fromgroups=#!topic/phonegap/PzqZEm8QKmc

like image 29
pablobart Avatar answered Nov 13 '22 12:11

pablobart


For future ref:

I just fixed this exact problem for myself.

If you are using Cordova cli, and have your config.xml updated, you can just remove ios as a platform and add it back. Then archive again from XCode.

cordova platform remove ios
cordova platform add ios

Hope that helps, worked perfectly for me,

like image 6
eton_ceb Avatar answered Nov 13 '22 11:11

eton_ceb


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.

like image 2
Jeffrey D. Hoffman Avatar answered Nov 13 '22 11:11

Jeffrey D. Hoffman