8

I have a project with Cordova(6.1.1)/Phonegap(5.3.10). I am trying to build an ipa file with Xcode 7.3. When I click on Product > Archive the build fails, and the log says: 'Cordova/CDVViewController.h' file not found. I can successfully build the project to a device, so i am kinda lost knowing what the problem might be.

I have tried to change the Header Search Path from

"$(OBJROOT)/UninstalledProducts/include"

to

"$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include"

from reading this post Xcode 7.2: In “Archive”: Getting the issue: “Cordova/CDVViewController.h’ file not found ”. While there is no such issues in building the app

I have tried to change chage to enable bitcode to "no", but still no luck at Archiving my app.

From many readings here on stackoverflow the issue seems to be with header search path, but this havent solved my issue. Dont know if there is something else on Xcode 7.3, because the other posts is with Xcode 7.2 and below. Dont know how to solve this issue, has anyone else experienced this problem?

Update (Solution):

Under Build Settings > Deployment > Install owner. I left that blank and then it finally worked.

Community
  • 1
  • 1
msk
  • 89
  • 1
  • 1
  • 5
  • did you tried doing it in both debug and release sections of Header Search Paths? – Gandhi Apr 11 '16 at 10:47
  • 1
    Try this out: 1) Run this in your terminal: cordova platform update ios 2) Open your project in Xcode 3) Go to Preference -> Locations -> Advanced 4) Choose "Unique" as the option for Build Location 5) Product -> Clean 6) Product -> Build – Gandhi Apr 11 '16 at 13:20
  • 1
    Thank you for your reply. Tried it, but still no luck. – msk Apr 12 '16 at 08:08
  • Just tested in Xcode7.3(7D175), cordova 6.1.1 Works fine for me – Gandhi Apr 13 '16 at 15:03
  • For the record, @Gandhi's method worked for me with Xcode 7.3.1 and Cordova 6.2.0. – wumbo Jul 06 '16 at 03:20
  • @wumbo thanks for the update. Have posed the answer, please upvote if it helped so that others get benefited too.cheers – Gandhi Jul 06 '16 at 03:35

3 Answers3

17

Try this out, this should work.

  • Run this in your terminal: cordova platform update ios

  • Open your project in Xcode

  • Go to Preference -> Locations -> Advanced

  • Choose "Unique" as the option for Build Location

  • Product -> Clean

  • Product -> Build

Try out cordova platform update ios as well as it fixed the problem for the questioner

Gandhi
  • 11,875
  • 4
  • 39
  • 63
  • 1
    `cordova platform update ios` was what I was missing to solve this. Thanks a lot. – Michał Rakowski Jul 26 '16 at 17:20
  • @Gandhi THANK YOU!! – Dom Hede Aug 04 '16 at 02:31
  • to me, it was --> Choose "Unique" as the option for Build Location – Adriano Spadoni Mar 13 '17 at 14:33
  • 1
    Wow, I spent quite some time looking for the answer and this solved it. Thank you! The Ionic/Cordova project was building fine from the terminal. Building it in Xcode 9 failed. It was not project specific, because it was the same for every Ionic/Cordova project. For me the solution was also choosing 'Unique' as the option for Build Location. It was set to 'Legacy'. – Wouter Jul 05 '18 at 15:55
1

If you have tried all the suggestions above and still it does not work. You can try these:

First check if you have this folder "CordovaLib", under: platforms->ios

Second, make sure you have the icons and splash images in your "resources" folder.

if not:

$ ionic resources

then run:

ionic platform remove ios
ionic platform add ios

These commands will install "CordovaLib" folder, then do the build again.

joemalski
  • 416
  • 6
  • 15
0

This does not work with Xcode 8. You have to reinstall latest version of cordova, and remove platform and add it again

npm un cordova
sudo npm install -g cordova // yarn global add cordova
alacret
  • 572
  • 4
  • 19