Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to compile Phonegap app locally

I'm unable to compile my app for iOS locally, Android works OK.

I have installed both cordova and phonegap using npm install -g [...]. I am running OSX (10.7.5).

Version outputs from both:

$ cordova -v
5.1.1
$ phonegap -v
0.9.4

I have XCode installed (v 4.6.2). I also have the command-line tools installed.

Both the cordova and phonegap tools fail to build, seemingly for the same reason. Running phonegap build ios outputs:

$ phonegap build ios
  phonegap  detecting iOS SDK environment...
  phonegap  using the local environment
  phonegap  compiling iOS...
     error  ENOENT, no such file or directory '/Users/mike/apps/***/platforms/ios/__CLI__/config.xml'

Here is the output from the same cordova command:

$ cordova build ios
cp: copyFileSync: could not write to dest file (code=ENOENT):/Users/mike/apps/***/platforms/ios/__CLI__/config.xml

cp: no such file or directory: /Users/mike/apps/***/platforms/ios/platform_www/*

Parsing /Users/mike/apps/***/platforms/ios/__CLI__/config.xml failed
Error: ENOENT, no such file or directory '/Users/mike/apps/***/platforms/ios/__CLI__/config.xml'
    at Error (native)
    at Object.fs.openSync (fs.js:500:18)
    at Object.fs.readFileSync (fs.js:352:15)
    at Object.module.exports.parseElementtreeSync (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/util/xml-helpers.js:118:27)
    at Object.ConfigParser (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/configparser/ConfigParser.js:33:24)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/prepare.js:115:32
    at Array.map (native)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/prepare.js:70:40
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)

It seems to me that there should be some replacement running on __CLI__ in the path that isn't happening, but it's difficult to tell. Below is a screenshot of the file structure this generates:

FileStructure

I am able to build using the remote build service, but it's quite laborious, as the app isn't properly loading so I need to do quite a bit of debugging to sort this out.

Node is installed at version 0.12.5. NPM is installed at version 2.11.2.

I have reinstalled the platform numerous times, and always get this error.

like image 511
Mike Avatar asked Jul 06 '15 10:07

Mike


1 Answers

This question is a little old, but I'll throw a few things out there:

  1. I've got a command line build of my ios platform running -- it does not have an __CLI__... subdirectory. Just a data point.
  2. I'm wondering if there isn't something weird with the way Xcode is set up in relation to its build path. See this answer to make sure the output directory is set correctly: still getting <Cordova/CDVViewController.h> file not found error in xcode. I've got a desktop and mobile app set up in Xcode, and I have to remember to switch this setting back and forth.
  3. PhoneGap / Cordova have been phasing out older versions of ios with their newer releases. It would not surprise me if cordova 5.1.1 did not support Xcode 4.6.2. You might want to try with an older release of the cordova library.
like image 54
eb1 Avatar answered Sep 20 '22 23:09

eb1