Apache Cordova
  1. Apache Cordova
  2. CB-4074

Error when adding android platform on Windows 7

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: CLI
    • Labels:
      None
    • Environment:

      Windows 7

      Description

      I got past the issue where I wasn't able to install cordova on my windows 7 machine. I create a new project just fine but when I tried to add android as a platform I see the following error:

      C:\workspaces\cordovacli\helloworld>cordova platform add android
      shell.js: internal error
      Error: EPERM, operation not permitted 'C:\Users\me\.cordova\lib\android\cordova\2.9.0\cordova-android-2.9.0-df1536e\test'
      at Object.fs.renameSync (fs.js:543:18)
      at C:\Users\me\AppData\Roaming\npm\node_modules\cordova\node_modules\shelljs\shell.js:487:8
      at Array.forEach (native)
      at Object._mv (C:\Users\me\AppData\Roaming\npm\node_modules\cordova\node_modules\shelljs\shell.js:463:11)
      at Object.mv (C:\Users\me\AppData\Roaming\npm\node_modules\cordova\node_modules\shelljs\shell.js:1471:23)
      at Extract.<anonymous> (C:\Users\me\AppData\Roaming\npm\node_modules\cordova\src\lazy_load.js:115:43)
      at Extract.EventEmitter.emit (events.js:117:20)
      at DirWriter.<anonymous> (C:\Users\me\AppData\Roaming\npm\node_modules\cordova\node_modules\tar\lib\extract.js:66:8)
      at DirWriter.EventEmitter.emit (events.js:117:20)
      at end (C:\Users\me\AppData\Roaming\npm\node_modules\cordova\node_modules\tar\node_modules\fstream\lib\writer.js:323:12)

      --------------
      note: I can use eclipse and create an android project with no problem and test on devices and emulators.

        Issue Links

          Activity

          Hide
          Mike Billau added a comment -

          This has popped up on stackoverflow a few times, I think it started after adding q.js - or at least, q.js seems to be the first thing to try to call xcopy.

          Is this a problem only when using the CLI? If so, we can add a NOTE: section to the documentation on this page: http://cordova.apache.org/docs/en/3.3.0/guide_cli_index.md.html#The%20Command-Line%20Interface
          Similar to the note about adding the npm directory to your path if you install Cordova globally.

          If you need xcopy on the path regardless of whether you use the CLI or the native workflow, then I think it should be in check_reqs.

          Created https://issues.apache.org/jira/browse/CB-4286 to track.

          Show
          Mike Billau added a comment - This has popped up on stackoverflow a few times, I think it started after adding q.js - or at least, q.js seems to be the first thing to try to call xcopy. Is this a problem only when using the CLI? If so, we can add a NOTE: section to the documentation on this page: http://cordova.apache.org/docs/en/3.3.0/guide_cli_index.md.html#The%20Command-Line%20Interface Similar to the note about adding the npm directory to your path if you install Cordova globally. If you need xcopy on the path regardless of whether you use the CLI or the native workflow, then I think it should be in check_reqs. Created https://issues.apache.org/jira/browse/CB-4286 to track.
          Hide
          Filip Maj added a comment -

          No but perhaps starting a "Known Issues" section at the bottom of the README would be a good start?

          Show
          Filip Maj added a comment - No but perhaps starting a "Known Issues" section at the bottom of the README would be a good start?
          Hide
          Lisa Seacat DeLuca added a comment -

          adding the xcopy location to my windows PATH variable did the trick! Closing. Thanks Filip Maj for helping to debug this. Do we have a document to help troubleshoot CLI issues going?

          Show
          Lisa Seacat DeLuca added a comment - adding the xcopy location to my windows PATH variable did the trick! Closing. Thanks Filip Maj for helping to debug this. Do we have a document to help troubleshoot CLI issues going?
          Hide
          Filip Maj added a comment -

          What if you run your command prompt in admin mode? Judging from your paths it looks like your user is IBM_ADMIN. Try running with your command prompt in administrator mode (right click on Command Prompt -> Run As Administrator)

          Show
          Filip Maj added a comment - What if you run your command prompt in admin mode? Judging from your paths it looks like your user is IBM_ADMIN. Try running with your command prompt in administrator mode (right click on Command Prompt -> Run As Administrator)
          Hide
          Lisa Seacat DeLuca added a comment -

          getting closer!! I added the xcopy location to my path variable and now I'm seeing more friendly errors. Path to xcopy was: C:\Windows\System32

          Show
          Lisa Seacat DeLuca added a comment - getting closer!! I added the xcopy location to my path variable and now I'm seeing more friendly errors. Path to xcopy was: C:\Windows\System32
          Hide
          Lisa Seacat DeLuca added a comment -

          I checked and made sure i had java_home set as well as ant and my path includes both the android tools and platform-tools dirs. At least my output is a little friendlier than "undefined"

          C:\workspaces\cordovacli\helloworld>cordova -d platform add android
          cordova library for "android" already exists. No need to download. Continuing.
          Checking if platform "android" passes minimum requirements...
          Checking Android requirements...
          Running "android list target" (output to follow)

          Error: The command `android` failed. Make sure you have the latest Android SDK installed, and the `android` command (inside the tools/ folder) added t
          o your path. Output:
          at C:\Users\IBM_ADMIN\AppData\Roaming\npm\node_modules\cordova\src\platform.js:185:42
          at C:\Users\IBM_ADMIN\AppData\Roaming\npm\node_modules\cordova\src\metadata\android_parser.js:50:13
          at C:\Users\IBM_ADMIN\AppData\Roaming\npm\node_modules\cordova\node_modules\shelljs\shell.js:1707:7
          at exithandler (child_process.js:633:7)
          at ChildProcess.errorhandler (child_process.js:649:5)
          at ChildProcess.EventEmitter.emit (events.js:95:17)
          at Process.ChildProcess._handle.onexit (child_process.js:787:12)

          --------------
          I'm still seeing the xcopy output so I'm googling that now

          C:\workspaces\cordovacli\helloworld>android list target
          'xcopy' is not recognized as an internal or external command,
          operable program or batch file.
          Available Android targets:
          ----------
          id: 1 or "android-17"
          Name: Android 4.2.2
          Type: Platform
          API level: 17
          Revision: 2
          Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
          ABIs : armeabi-v7a, mips, x86
          ----------
          id: 2 or "Google Inc.:Google APIs:17"
          Name: Google APIs
          Type: Add-On
          Vendor: Google Inc.
          Revision: 3
          Description: Android + Google APIs
          Based on Android 4.2.2 (API level 17)
          Libraries:

          • com.google.android.media.effects (effects.jar)
            Collection of video effects
          • com.android.future.usb.accessory (usb.jar)
            API for USB Accessories
          • com.google.android.maps (maps.jar)
            API for Google Maps
            Skins: WSVGA, HVGA, WXGA720, WXGA800-7in, WXGA800, WQVGA432, WVGA854, WQVGA400, WVGA800 (default), QVGA
            ABIs : armeabi-v7a

          C:\workspaces\cordovacli\helloworld>

          Show
          Lisa Seacat DeLuca added a comment - I checked and made sure i had java_home set as well as ant and my path includes both the android tools and platform-tools dirs. At least my output is a little friendlier than "undefined" C:\workspaces\cordovacli\helloworld>cordova -d platform add android cordova library for "android" already exists. No need to download. Continuing. Checking if platform "android" passes minimum requirements... Checking Android requirements... Running "android list target" (output to follow) Error: The command `android` failed. Make sure you have the latest Android SDK installed, and the `android` command (inside the tools/ folder) added t o your path. Output: at C:\Users\IBM_ADMIN\AppData\Roaming\npm\node_modules\cordova\src\platform.js:185:42 at C:\Users\IBM_ADMIN\AppData\Roaming\npm\node_modules\cordova\src\metadata\android_parser.js:50:13 at C:\Users\IBM_ADMIN\AppData\Roaming\npm\node_modules\cordova\node_modules\shelljs\shell.js:1707:7 at exithandler (child_process.js:633:7) at ChildProcess.errorhandler (child_process.js:649:5) at ChildProcess.EventEmitter.emit (events.js:95:17) at Process.ChildProcess._handle.onexit (child_process.js:787:12) -------------- I'm still seeing the xcopy output so I'm googling that now C:\workspaces\cordovacli\helloworld>android list target 'xcopy' is not recognized as an internal or external command, operable program or batch file. Available Android targets: ---------- id: 1 or "android-17" Name: Android 4.2.2 Type: Platform API level: 17 Revision: 2 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in ABIs : armeabi-v7a, mips, x86 ---------- id: 2 or "Google Inc.:Google APIs:17" Name: Google APIs Type: Add-On Vendor: Google Inc. Revision: 3 Description: Android + Google APIs Based on Android 4.2.2 (API level 17) Libraries: com.google.android.media.effects (effects.jar) Collection of video effects com.android.future.usb.accessory (usb.jar) API for USB Accessories com.google.android.maps (maps.jar) API for Google Maps Skins: WSVGA, HVGA, WXGA720, WXGA800-7in, WXGA800, WQVGA432, WVGA854, WQVGA400, WVGA800 (default), QVGA ABIs : armeabi-v7a C:\workspaces\cordovacli\helloworld>
          Hide
          Filip Maj added a comment -

          For what it's worth, on my new Windows 7 system with the latest cordova-cli @ 2.9.7 installed, after adding android to my path, I get the following error when attempting to add android as a platform:

          The JAVA_HOME environment variable is not set.
          Set JAVA_HOME to an existing JRE directory.
          

          So I went and downloaded the JDK. Then the tools complained about javac.exec not being on the PATh. Added that to the PATH. Then the tools complained about not having ant.bat on the PATH. So I went and downloaded Apache ANT, extracted, and added its executable to the PATH.

          THEN: IT WORKED!

          I think the core issue here was that the checks for the environment had a bug where issues would not be reported back to the tools properly, hence you ended up with "undefined" values when you wanted to find out what was wrong with your env.

          Let me know if that helps you Lisa Seacat DeLuca

          Show
          Filip Maj added a comment - For what it's worth, on my new Windows 7 system with the latest cordova-cli @ 2.9.7 installed, after adding android to my path, I get the following error when attempting to add android as a platform: The JAVA_HOME environment variable is not set. Set JAVA_HOME to an existing JRE directory. So I went and downloaded the JDK. Then the tools complained about javac.exec not being on the PATh. Added that to the PATH. Then the tools complained about not having ant.bat on the PATH. So I went and downloaded Apache ANT, extracted, and added its executable to the PATH. THEN: IT WORKED! I think the core issue here was that the checks for the environment had a bug where issues would not be reported back to the tools properly, hence you ended up with "undefined" values when you wanted to find out what was wrong with your env. Let me know if that helps you Lisa Seacat DeLuca
          Hide
          Filip Maj added a comment -

          Lisa Seacat DeLuca I've pushed up cordova-cli 2.9.7 to npm. CAn you upgrade and try going through your motions? At least now the error messages SHOULD be better.

          In the mean time I am trying to reproduce your issue on this brand new windows 7 machine Ive got my hands on.

          Show
          Filip Maj added a comment - Lisa Seacat DeLuca I've pushed up cordova-cli 2.9.7 to npm. CAn you upgrade and try going through your motions? At least now the error messages SHOULD be better. In the mean time I am trying to reproduce your issue on this brand new windows 7 machine Ive got my hands on.
          Hide
          Filip Maj added a comment -

          Linking to CB-4196

          I think the two exhibit the exact same symptom. I got my hands on a vanilla Windows 7 machine (Windows 8 did not exhibit any of these issues) so I am trying to get to the bottom of this.

          WINDOWS! What a wonderful operating system! </sarcasm>

          Show
          Filip Maj added a comment - Linking to CB-4196 I think the two exhibit the exact same symptom. I got my hands on a vanilla Windows 7 machine (Windows 8 did not exhibit any of these issues) so I am trying to get to the bottom of this. WINDOWS! What a wonderful operating system! </sarcasm>
          Hide
          Lisa Seacat DeLuca added a comment -

          fyi, i can install the cli no problem on my mac and add the android platform. This is definitely specific to my windows 7 environment. Filip Maj anything else I should try to help resolve this? I'm sure there are going to be a lot of windows users for the 3.0 release.

          Show
          Lisa Seacat DeLuca added a comment - fyi, i can install the cli no problem on my mac and add the android platform. This is definitely specific to my windows 7 environment. Filip Maj anything else I should try to help resolve this? I'm sure there are going to be a lot of windows users for the 3.0 release.
          Hide
          Lisa Seacat DeLuca added a comment -

          almost identical as the last command:

          > s.exec('which android',

          {silent:true, async:true}

          , function(code, output)

          { console.dir(arguments); }

          )
          { domain: null,
          _events:

          { close: [Function: exithandler], error: [Function: errorhandler] }

          ,
          _maxListeners: 10,
          _closesNeeded: 1,
          _closesGot: 0,
          connected: false,
          signalCode: null,
          exitCode: null,
          killed: false,
          _handle:

          { owner: [Circular], onexit: [Function], pid: 0 }

          ,
          pid: 0,
          stdin:
          { _connecting: false,
          _handle: null,
          _readableState:

          { highWaterMark: 16384, buffer: [], length: 0, pipes: null, pipesCount: 0, flowing: false, ended: false, endEmitted: false, reading: false, calledRead: false, sync: true, needReadable: false, emittedReadable: false, readableListening: false, objectMode: false, defaultEncoding: 'utf8', ranOut: false, awaitDrain: 0, readingMore: false, decoder: null, encoding: null }

          ,
          readable: false,
          domain: null,
          _events:

          { end: [Object], finish: [Function: onSocketFinish], _socketEnd: [Function: onSocketEnd] }

          ,
          _maxListeners: 10,
          _writableState:

          { highWaterMark: 16384, objectMode: false, needDrain: false, ending: false, ended: false, finished: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, sync: true, bufferProcessing: false, onwrite: [Function], writecb: null, writelen: 0, buffer: [] }

          ,
          writable: true,
          allowHalfOpen: false,
          onend: null,
          destroyed: false,
          errorEmitted: false,
          bytesRead: 0,
          _bytesDispatched: 0,
          _pendingData: null,
          _pendingEncoding: '' },
          stdout:
          { _connecting: false,
          _handle: null,
          _readableState:

          { highWaterMark: 16384, buffer: [], length: 0, pipes: null, pipesCount: 0, flowing: false, ended: false, endEmitted: false, reading: true, calledRead: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, objectMode: false, defaultEncoding: 'utf8', ranOut: false, awaitDrain: 0, readingMore: false, decoder: [Object], encoding: 'utf8' }

          ,
          readable: true,
          domain: null,
          _events:

          { end: [Object], finish: [Function: onSocketFinish], _socketEnd: [Function: onSocketEnd], data: [Object], readable: [Function], connect: [Object] }

          ,
          _maxListeners: 10,
          _writableState:

          { highWaterMark: 16384, objectMode: false, needDrain: false, ending: false, ended: false, finished: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, sync: true, bufferProcessing: false, onwrite: [Function], writecb: null, writelen: 0, buffer: [] }

          ,
          writable: false,
          allowHalfOpen: false,
          onend: null,
          destroyed: false,
          errorEmitted: false,
          bytesRead: 0,
          _bytesDispatched: 0,
          _pendingData: null,
          _pendingEncoding: '',
          pipe: [Function],
          addListener: [Function],
          on: [Function],
          pause: [Function],
          resume: [Function],
          read: [Function],
          _consuming: true },
          stderr:
          { _connecting: false,
          _handle: null,
          _readableState:

          { highWaterMark: 16384, buffer: [], length: 0, pipes: null, pipesCount: 0, flowing: false, ended: false, endEmitted: false, reading: true, calledRead: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, objectMode: false, defaultEncoding: 'utf8', ranOut: false, awaitDrain: 0, readingMore: false, decoder: [Object], encoding: 'utf8' }

          ,
          readable: true,
          domain: null,
          _events:

          { end: [Object], finish: [Function: onSocketFinish], _socketEnd: [Function: onSocketEnd], data: [Object], readable: [Function], connect: [Object] }

          ,
          _maxListeners: 10,
          _writableState:

          { highWaterMark: 16384, objectMode: false, needDrain: false, ending: false, ended: false, finished: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, sync: true, bufferProcessing: false, onwrite: [Function], writecb: null, writelen: 0, buffer: [] }

          ,
          writable: false,
          allowHalfOpen: false,
          onend: null,
          destroyed: false,
          errorEmitted: false,
          bytesRead: 0,
          _bytesDispatched: 0,
          _pendingData: null,
          _pendingEncoding: '',
          pipe: [Function],
          addListener: [Function],
          on: [Function],
          pause: [Function],
          resume: [Function],
          read: [Function],
          _consuming: true },
          stdio:
          [

          { _connecting: false, _handle: null, _readableState: [Object], readable: false, domain: null, _events: [Object], _maxListeners: 10, _writableState: [Object], writable: true, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '' }

          ,

          { _connecting: false, _handle: null, _readableState: [Object], readable: true, domain: null, _events: [Object], _maxListeners: 10, _writableState: [Object], writable: false, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '', pipe: [Function], addListener: [Function], on: [Function], pause: [Function], resume: [Function], read: [Function], _consuming: true }

          ,

          { _connecting: false, _handle: null, _readableState: [Object], readable: true, domain: null, _events: [Object], _maxListeners: 10, _writableState: [Object], writable: false, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '', pipe: [Function], addListener: [Function], on: [Function], pause: [Function], resume: [Function], read: [Function], _consuming: true }

          ] }
          >

          { '0': 'ENOENT', '1': '' }
          Show
          Lisa Seacat DeLuca added a comment - almost identical as the last command: > s.exec('which android', {silent:true, async:true} , function(code, output) { console.dir(arguments); } ) { domain: null, _events: { close: [Function: exithandler], error: [Function: errorhandler] } , _maxListeners: 10, _closesNeeded: 1, _closesGot: 0, connected: false, signalCode: null, exitCode: null, killed: false, _handle: { owner: [Circular], onexit: [Function], pid: 0 } , pid: 0, stdin: { _connecting: false, _handle: null, _readableState: { highWaterMark: 16384, buffer: [], length: 0, pipes: null, pipesCount: 0, flowing: false, ended: false, endEmitted: false, reading: false, calledRead: false, sync: true, needReadable: false, emittedReadable: false, readableListening: false, objectMode: false, defaultEncoding: 'utf8', ranOut: false, awaitDrain: 0, readingMore: false, decoder: null, encoding: null } , readable: false, domain: null, _events: { end: [Object], finish: [Function: onSocketFinish], _socketEnd: [Function: onSocketEnd] } , _maxListeners: 10, _writableState: { highWaterMark: 16384, objectMode: false, needDrain: false, ending: false, ended: false, finished: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, sync: true, bufferProcessing: false, onwrite: [Function], writecb: null, writelen: 0, buffer: [] } , writable: true, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '' }, stdout: { _connecting: false, _handle: null, _readableState: { highWaterMark: 16384, buffer: [], length: 0, pipes: null, pipesCount: 0, flowing: false, ended: false, endEmitted: false, reading: true, calledRead: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, objectMode: false, defaultEncoding: 'utf8', ranOut: false, awaitDrain: 0, readingMore: false, decoder: [Object], encoding: 'utf8' } , readable: true, domain: null, _events: { end: [Object], finish: [Function: onSocketFinish], _socketEnd: [Function: onSocketEnd], data: [Object], readable: [Function], connect: [Object] } , _maxListeners: 10, _writableState: { highWaterMark: 16384, objectMode: false, needDrain: false, ending: false, ended: false, finished: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, sync: true, bufferProcessing: false, onwrite: [Function], writecb: null, writelen: 0, buffer: [] } , writable: false, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '', pipe: [Function] , addListener: [Function] , on: [Function] , pause: [Function] , resume: [Function] , read: [Function] , _consuming: true }, stderr: { _connecting: false, _handle: null, _readableState: { highWaterMark: 16384, buffer: [], length: 0, pipes: null, pipesCount: 0, flowing: false, ended: false, endEmitted: false, reading: true, calledRead: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, objectMode: false, defaultEncoding: 'utf8', ranOut: false, awaitDrain: 0, readingMore: false, decoder: [Object], encoding: 'utf8' } , readable: true, domain: null, _events: { end: [Object], finish: [Function: onSocketFinish], _socketEnd: [Function: onSocketEnd], data: [Object], readable: [Function], connect: [Object] } , _maxListeners: 10, _writableState: { highWaterMark: 16384, objectMode: false, needDrain: false, ending: false, ended: false, finished: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, sync: true, bufferProcessing: false, onwrite: [Function], writecb: null, writelen: 0, buffer: [] } , writable: false, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '', pipe: [Function] , addListener: [Function] , on: [Function] , pause: [Function] , resume: [Function] , read: [Function] , _consuming: true }, stdio: [ { _connecting: false, _handle: null, _readableState: [Object], readable: false, domain: null, _events: [Object], _maxListeners: 10, _writableState: [Object], writable: true, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '' } , { _connecting: false, _handle: null, _readableState: [Object], readable: true, domain: null, _events: [Object], _maxListeners: 10, _writableState: [Object], writable: false, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '', pipe: [Function], addListener: [Function], on: [Function], pause: [Function], resume: [Function], read: [Function], _consuming: true } , { _connecting: false, _handle: null, _readableState: [Object], readable: true, domain: null, _events: [Object], _maxListeners: 10, _writableState: [Object], writable: false, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '', pipe: [Function], addListener: [Function], on: [Function], pause: [Function], resume: [Function], read: [Function], _consuming: true } ] } > { '0': 'ENOENT', '1': '' }
          Hide
          Filip Maj added a comment -

          What if you run which android in that function instead of android list target

          Show
          Filip Maj added a comment - What if you run which android in that function instead of android list target
          Hide
          Filip Maj added a comment -

          So the response from shelling out from node to android list target yields an error object of ENOENT. That is the issue. As to why that happens, I am not sure..

          Show
          Filip Maj added a comment - So the response from shelling out from node to android list target yields an error object of ENOENT. That is the issue. As to why that happens, I am not sure..
          Hide
          Lisa Seacat DeLuca added a comment -

          > s.exec('android list target',

          {silent:true, async:true}

          , function(code, output)

          { console.dir(arguments); }

          )
          { domain: null,
          _events:

          { close: [Function: exithandler], error: [Function: errorhandler] }

          ,
          _maxListeners: 10,
          _closesNeeded: 1,
          _closesGot: 0,
          connected: false,
          signalCode: null,
          exitCode: null,
          killed: false,
          _handle:

          { owner: [Circular], onexit: [Function], pid: 0 }

          ,
          pid: 0,
          stdin:
          { _connecting: false,
          _handle: null,
          _readableState:

          { highWaterMark: 16384, buffer: [], length: 0, pipes: null, pipesCount: 0, flowing: false, ended: false, endEmitted: false, reading: false, calledRead: false, sync: true, needReadable: false, emittedReadable: false, readableListening: false, objectMode: false, defaultEncoding: 'utf8', ranOut: false, awaitDrain: 0, readingMore: false, decoder: null, encoding: null }

          ,
          readable: false,
          domain: null,
          _events:

          { end: [Object], finish: [Function: onSocketFinish], _socketEnd: [Function: onSocketEnd] }

          ,
          _maxListeners: 10,
          _writableState:

          { highWaterMark: 16384, objectMode: false, needDrain: false, ending: false, ended: false, finished: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, sync: true, bufferProcessing: false, onwrite: [Function], writecb: null, writelen: 0, buffer: [] }

          ,
          writable: true,
          allowHalfOpen: false,
          onend: null,
          destroyed: false,
          errorEmitted: false,
          bytesRead: 0,
          _bytesDispatched: 0,
          _pendingData: null,
          _pendingEncoding: '' },
          stdout:
          { _connecting: false,
          _handle: null,
          _readableState:

          { highWaterMark: 16384, buffer: [], length: 0, pipes: null, pipesCount: 0, flowing: false, ended: false, endEmitted: false, reading: true, calledRead: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, objectMode: false, defaultEncoding: 'utf8', ranOut: false, awaitDrain: 0, readingMore: false, decoder: [Object], encoding: 'utf8' }

          ,
          readable: true,
          domain: null,
          _events:

          { end: [Object], finish: [Function: onSocketFinish], _socketEnd: [Function: onSocketEnd], data: [Object], readable: [Function], connect: [Object] }

          ,
          _maxListeners: 10,
          _writableState:

          { highWaterMark: 16384, objectMode: false, needDrain: false, ending: false, ended: false, finished: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, sync: true, bufferProcessing: false, onwrite: [Function], writecb: null, writelen: 0, buffer: [] }

          ,
          writable: false,
          allowHalfOpen: false,
          onend: null,
          destroyed: false,
          errorEmitted: false,
          bytesRead: 0,
          _bytesDispatched: 0,
          _pendingData: null,
          _pendingEncoding: '',
          pipe: [Function],
          addListener: [Function],
          on: [Function],
          pause: [Function],
          resume: [Function],
          read: [Function],
          _consuming: true },
          stderr:
          { _connecting: false,
          _handle: null,
          _readableState:

          { highWaterMark: 16384, buffer: [], length: 0, pipes: null, pipesCount: 0, flowing: false, ended: false, endEmitted: false, reading: true, calledRead: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, objectMode: false, defaultEncoding: 'utf8', ranOut: false, awaitDrain: 0, readingMore: false, decoder: [Object], encoding: 'utf8' }

          ,
          readable: true,
          domain: null,
          _events:

          { end: [Object], finish: [Function: onSocketFinish], _socketEnd: [Function: onSocketEnd], data: [Object], readable: [Function], connect: [Object] }

          ,
          _maxListeners: 10,
          _writableState:

          { highWaterMark: 16384, objectMode: false, needDrain: false, ending: false, ended: false, finished: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, sync: true, bufferProcessing: false, onwrite: [Function], writecb: null, writelen: 0, buffer: [] }

          ,
          writable: false,
          allowHalfOpen: false,
          onend: null,
          destroyed: false,
          errorEmitted: false,
          bytesRead: 0,
          _bytesDispatched: 0,
          _pendingData: null,
          _pendingEncoding: '',
          pipe: [Function],
          addListener: [Function],
          on: [Function],
          pause: [Function],
          resume: [Function],
          read: [Function],
          _consuming: true },
          stdio:
          [

          { _connecting: false, _handle: null, _readableState: [Object], readable: false, domain: null, _events: [Object], _maxListeners: 10, _writableState: [Object], writable: true, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '' }

          ,

          { _connecting: false, _handle: null, _readableState: [Object], readable: true, domain: null, _events: [Object], _maxListeners: 10, _writableState: [Object], writable: false, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '', pipe: [Function], addListener: [Function], on: [Function], pause: [Function], resume: [Function], read: [Function], _consuming: true }

          ,

          { _connecting: false, _handle: null, _readableState: [Object], readable: true, domain: null, _events: [Object], _maxListeners: 10, _writableState: [Object], writable: false, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '', pipe: [Function], addListener: [Function], on: [Function], pause: [Function], resume: [Function], read: [Function], _consuming: true }

          ] }
          >

          { '0': 'ENOENT', '1': '' }

          ------------ not seeing the same output as you. Sorry for not responding faster. I've been in class all week.

          Show
          Lisa Seacat DeLuca added a comment - > s.exec('android list target', {silent:true, async:true} , function(code, output) { console.dir(arguments); } ) { domain: null, _events: { close: [Function: exithandler], error: [Function: errorhandler] } , _maxListeners: 10, _closesNeeded: 1, _closesGot: 0, connected: false, signalCode: null, exitCode: null, killed: false, _handle: { owner: [Circular], onexit: [Function], pid: 0 } , pid: 0, stdin: { _connecting: false, _handle: null, _readableState: { highWaterMark: 16384, buffer: [], length: 0, pipes: null, pipesCount: 0, flowing: false, ended: false, endEmitted: false, reading: false, calledRead: false, sync: true, needReadable: false, emittedReadable: false, readableListening: false, objectMode: false, defaultEncoding: 'utf8', ranOut: false, awaitDrain: 0, readingMore: false, decoder: null, encoding: null } , readable: false, domain: null, _events: { end: [Object], finish: [Function: onSocketFinish], _socketEnd: [Function: onSocketEnd] } , _maxListeners: 10, _writableState: { highWaterMark: 16384, objectMode: false, needDrain: false, ending: false, ended: false, finished: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, sync: true, bufferProcessing: false, onwrite: [Function], writecb: null, writelen: 0, buffer: [] } , writable: true, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '' }, stdout: { _connecting: false, _handle: null, _readableState: { highWaterMark: 16384, buffer: [], length: 0, pipes: null, pipesCount: 0, flowing: false, ended: false, endEmitted: false, reading: true, calledRead: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, objectMode: false, defaultEncoding: 'utf8', ranOut: false, awaitDrain: 0, readingMore: false, decoder: [Object], encoding: 'utf8' } , readable: true, domain: null, _events: { end: [Object], finish: [Function: onSocketFinish], _socketEnd: [Function: onSocketEnd], data: [Object], readable: [Function], connect: [Object] } , _maxListeners: 10, _writableState: { highWaterMark: 16384, objectMode: false, needDrain: false, ending: false, ended: false, finished: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, sync: true, bufferProcessing: false, onwrite: [Function], writecb: null, writelen: 0, buffer: [] } , writable: false, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '', pipe: [Function] , addListener: [Function] , on: [Function] , pause: [Function] , resume: [Function] , read: [Function] , _consuming: true }, stderr: { _connecting: false, _handle: null, _readableState: { highWaterMark: 16384, buffer: [], length: 0, pipes: null, pipesCount: 0, flowing: false, ended: false, endEmitted: false, reading: true, calledRead: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, objectMode: false, defaultEncoding: 'utf8', ranOut: false, awaitDrain: 0, readingMore: false, decoder: [Object], encoding: 'utf8' } , readable: true, domain: null, _events: { end: [Object], finish: [Function: onSocketFinish], _socketEnd: [Function: onSocketEnd], data: [Object], readable: [Function], connect: [Object] } , _maxListeners: 10, _writableState: { highWaterMark: 16384, objectMode: false, needDrain: false, ending: false, ended: false, finished: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, sync: true, bufferProcessing: false, onwrite: [Function], writecb: null, writelen: 0, buffer: [] } , writable: false, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '', pipe: [Function] , addListener: [Function] , on: [Function] , pause: [Function] , resume: [Function] , read: [Function] , _consuming: true }, stdio: [ { _connecting: false, _handle: null, _readableState: [Object], readable: false, domain: null, _events: [Object], _maxListeners: 10, _writableState: [Object], writable: true, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '' } , { _connecting: false, _handle: null, _readableState: [Object], readable: true, domain: null, _events: [Object], _maxListeners: 10, _writableState: [Object], writable: false, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '', pipe: [Function], addListener: [Function], on: [Function], pause: [Function], resume: [Function], read: [Function], _consuming: true } , { _connecting: false, _handle: null, _readableState: [Object], readable: true, domain: null, _events: [Object], _maxListeners: 10, _writableState: [Object], writable: false, allowHalfOpen: false, onend: null, destroyed: false, errorEmitted: false, bytesRead: 0, _bytesDispatched: 0, _pendingData: null, _pendingEncoding: '', pipe: [Function], addListener: [Function], on: [Function], pause: [Function], resume: [Function], read: [Function], _consuming: true } ] } > { '0': 'ENOENT', '1': '' } ------------ not seeing the same output as you. Sorry for not responding faster. I've been in class all week.
          Hide
          Filip Maj added a comment -

          Yes, let's keep going down the rabbit hole

          Do you have the cordova-cli code cloned locally? If so, can you cd into the cli directory and run the following commands, and post the output back here?

          $ cd cordova-cli
          $ npm install
          $ node
          > s=require('shelljs')
          > s.exec('android list target', {silent:true, async:true}, function(code, output) { console.dir(arguments); })
          

          After a second or two you should see an output that looks like

          > { '0': 0,
              '1': 'Available Android targets...
            .... lots more output ....
            }
          

          That's the output I'm interested in.

          Show
          Filip Maj added a comment - Yes, let's keep going down the rabbit hole Do you have the cordova-cli code cloned locally? If so, can you cd into the cli directory and run the following commands, and post the output back here? $ cd cordova-cli $ npm install $ node > s=require('shelljs') > s.exec('android list target', {silent:true, async:true}, function(code, output) { console.dir(arguments); }) After a second or two you should see an output that looks like > { '0': 0, '1': 'Available Android targets... .... lots more output .... } That's the output I'm interested in.
          Hide
          Lisa Seacat DeLuca added a comment -

          Filip Maj I see "Hello":

          C:\Users\IBM_ADMIN>android list target && echo "Hello"
          'xcopy' is not recognized as an internal or external command,
          operable program or batch file.
          Available Android targets:
          ----------
          id: 1 or "android-17"
          Name: Android 4.2.2
          Type: Platform
          API level: 17
          Revision: 2
          Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
          ABIs : armeabi-v7a, mips, x86
          ----------
          id: 2 or "Google Inc.:Google APIs:17"
          Name: Google APIs
          Type: Add-On
          Vendor: Google Inc.
          Revision: 3
          Description: Android + Google APIs
          Based on Android 4.2.2 (API level 17)
          Libraries:

          • com.google.android.media.effects (effects.jar)
            Collection of video effects
          • com.android.future.usb.accessory (usb.jar)
            API for USB Accessories
          • com.google.android.maps (maps.jar)
            API for Google Maps
            Skins: WSVGA, HVGA, WXGA720, WXGA800-7in, WXGA800, WQVGA432, WVGA854, WQVGA400, WVGA800 (default), QVGA
            ABIs : armeabi-v7a
            "Hello"

          C:\Users\IBM_ADMIN>

          Any other suggestions?

          Show
          Lisa Seacat DeLuca added a comment - Filip Maj I see "Hello": C:\Users\IBM_ADMIN>android list target && echo "Hello" 'xcopy' is not recognized as an internal or external command, operable program or batch file. Available Android targets: ---------- id: 1 or "android-17" Name: Android 4.2.2 Type: Platform API level: 17 Revision: 2 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in ABIs : armeabi-v7a, mips, x86 ---------- id: 2 or "Google Inc.:Google APIs:17" Name: Google APIs Type: Add-On Vendor: Google Inc. Revision: 3 Description: Android + Google APIs Based on Android 4.2.2 (API level 17) Libraries: com.google.android.media.effects (effects.jar) Collection of video effects com.android.future.usb.accessory (usb.jar) API for USB Accessories com.google.android.maps (maps.jar) API for Google Maps Skins: WSVGA, HVGA, WXGA720, WXGA800-7in, WXGA800, WQVGA432, WVGA854, WQVGA400, WVGA800 (default), QVGA ABIs : armeabi-v7a "Hello" C:\Users\IBM_ADMIN> Any other suggestions?
          Hide
          Filip Maj added a comment -

          Lisa Seacat DeLuca can you confirm what the exit code is when you run android list target? The xcopy error at the top of the output is leading me to believe it is a non-zero code. Additionally, the fact that shelling out to both xcodebuild -version (as iOS does) and android list target yields an undefined output, so both are failing similarly. The iOS failure is expected but the Android one is not.

          Perhaps try running android list target && echo "Hello" and see if you get the "Hello" output. If not, then the exit code for your android list target call is non-zero and thus, the CLI thinks it is failing.

          Show
          Filip Maj added a comment - Lisa Seacat DeLuca can you confirm what the exit code is when you run android list target ? The xcopy error at the top of the output is leading me to believe it is a non-zero code. Additionally, the fact that shelling out to both xcodebuild -version (as iOS does) and android list target yields an undefined output, so both are failing similarly. The iOS failure is expected but the Android one is not. Perhaps try running android list target && echo "Hello" and see if you get the "Hello" output. If not, then the exit code for your android list target call is non-zero and thus, the CLI thinks it is failing.
          Hide
          Lisa Seacat DeLuca added a comment -

          I followed Amza Marian's advie, uninstalled cordova, cleared the cache, deleted the user .cordova dir, and reinstalled. Still getting the undefined errors (note that it throws an error for both android and ios):

          C:\workspaces\cordovacli>cordova create ./helloworld com.helloworld helloworld

          C:\workspaces\cordovacli>cd helloworld

          C:\workspaces\cordovacli\helloworld>cordova -d platform add android
          Requesting https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=snapshot;h=2.9.0;sf=tgz...
          Download complete. Extracting...
          Checking if platform "android" passes minimum requirements...
          Checking Android requirements...
          Running "android list target" (output to follow)

          undefined

          C:\workspaces\cordovacli\helloworld>cordova -d platform add ios
          Requesting https://git-wip-us.apache.org/repos/asf?p=cordova-ios.git;a=snapshot;h=2.9.0;sf=tgz...
          Download complete. Extracting...
          Checking if platform "ios" passes minimum requirements...
          Checking iOS requirements...
          Running "xcodebuild -version" (output to follow)

          undefined

          C:\workspaces\cordovacli\helloworld>

          Show
          Lisa Seacat DeLuca added a comment - I followed Amza Marian 's advie, uninstalled cordova, cleared the cache, deleted the user .cordova dir, and reinstalled. Still getting the undefined errors (note that it throws an error for both android and ios): C:\workspaces\cordovacli>cordova create ./helloworld com.helloworld helloworld C:\workspaces\cordovacli>cd helloworld C:\workspaces\cordovacli\helloworld>cordova -d platform add android Requesting https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=snapshot;h=2.9.0;sf=tgz ... Download complete. Extracting... Checking if platform "android" passes minimum requirements... Checking Android requirements... Running "android list target" (output to follow) undefined C:\workspaces\cordovacli\helloworld>cordova -d platform add ios Requesting https://git-wip-us.apache.org/repos/asf?p=cordova-ios.git;a=snapshot;h=2.9.0;sf=tgz ... Download complete. Extracting... Checking if platform "ios" passes minimum requirements... Checking iOS requirements... Running "xcodebuild -version" (output to follow) undefined C:\workspaces\cordovacli\helloworld>
          Hide
          Lisa Seacat DeLuca added a comment -

          Still having issues and android -h and android list target work just fine. See output:

          C:\workspaces\cordovacli\helloworld>android list target
          'xcopy' is not recognized as an internal or external command,
          operable program or batch file.
          Available Android targets:
          ----------
          id: 1 or "android-17"
          Name: Android 4.2.2
          Type: Platform
          API level: 17
          Revision: 2
          Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
          ABIs : armeabi-v7a, mips, x86
          ----------
          id: 2 or "Google Inc.:Google APIs:17"
          Name: Google APIs
          Type: Add-On
          Vendor: Google Inc.
          Revision: 3
          Description: Android + Google APIs
          Based on Android 4.2.2 (API level 17)
          Libraries:

          • com.google.android.media.effects (effects.jar)
            Collection of video effects
          • com.android.future.usb.accessory (usb.jar)
            API for USB Accessories
          • com.google.android.maps (maps.jar)
            API for Google Maps
            Skins: WSVGA, HVGA, WXGA720, WXGA800-7in, WXGA800, WQVGA432, WVGA854, WQVGA400, WVGA800 (default), QVGA
            ABIs : armeabi-v7a

          C:\workspaces\cordovacli\helloworld>cordova -d platform add android
          cordova library for "android" already exists. No need to download. Continuing.
          Checking if platform "android" passes minimum requirements...
          Checking Android requirements...
          Running "android list target" (output to follow)

          undefined

          C:\workspaces\cordovacli\helloworld>

          -------------------

          I'm going to try removing everything and reinstalling the cli.

          Show
          Lisa Seacat DeLuca added a comment - Still having issues and android -h and android list target work just fine. See output: C:\workspaces\cordovacli\helloworld>android list target 'xcopy' is not recognized as an internal or external command, operable program or batch file. Available Android targets: ---------- id: 1 or "android-17" Name: Android 4.2.2 Type: Platform API level: 17 Revision: 2 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in ABIs : armeabi-v7a, mips, x86 ---------- id: 2 or "Google Inc.:Google APIs:17" Name: Google APIs Type: Add-On Vendor: Google Inc. Revision: 3 Description: Android + Google APIs Based on Android 4.2.2 (API level 17) Libraries: com.google.android.media.effects (effects.jar) Collection of video effects com.android.future.usb.accessory (usb.jar) API for USB Accessories com.google.android.maps (maps.jar) API for Google Maps Skins: WSVGA, HVGA, WXGA720, WXGA800-7in, WXGA800, WQVGA432, WVGA854, WQVGA400, WVGA800 (default), QVGA ABIs : armeabi-v7a C:\workspaces\cordovacli\helloworld>cordova -d platform add android cordova library for "android" already exists. No need to download. Continuing. Checking if platform "android" passes minimum requirements... Checking Android requirements... Running "android list target" (output to follow) undefined C:\workspaces\cordovacli\helloworld> ------------------- I'm going to try removing everything and reinstalling the cli.
          Hide
          Michael Brooks added a comment -

          Awesome, it looks as though tex has figured out one issue. Anyone running into this in the future should try to first delete their ~/.cordova/lib/android/cordova/2.9.0/ directory. The download may have been corrupt or the library may have been installed with permissions that the regular user cannot read.

          I'm leaving this issue open for Lisa Seacat DeLuca's issue around the Android SDK.

          For what it's worth, I am using the Android ADT-Bundle on Windows 7. It appears to be the only SDK download option.

          Lisa Seacat DeLuca can you run either of these commands from the command-line:

          • android -h
          • android list target
          Show
          Michael Brooks added a comment - Awesome, it looks as though tex has figured out one issue. Anyone running into this in the future should try to first delete their ~/.cordova/lib/android/cordova/2.9.0/ directory. The download may have been corrupt or the library may have been installed with permissions that the regular user cannot read. I'm leaving this issue open for Lisa Seacat DeLuca 's issue around the Android SDK. For what it's worth, I am using the Android ADT-Bundle on Windows 7. It appears to be the only SDK download option. Lisa Seacat DeLuca can you run either of these commands from the command-line: android -h android list target
          Hide
          tex added a comment - - edited

          i think i have found the solution (for my own issue at least, but maybe it can help for the other one),

          i have tried multiple times to make a clean re-install of cordova , each time with "npm uninstall -g cordova", "npm cache clean", but it was not working .
          today i have tried again, but this time, in addition to this, i have manualy deleted the .cordova folder in my User folder, and it works !

          so my conclusion is that something went wrong when the .cordova folder have been created (maybe a first run without the admin rights) and then this folder is never updated , even when uninstalling and cleaning cache (maybe i miss an option).

          Show
          tex added a comment - - edited i think i have found the solution (for my own issue at least, but maybe it can help for the other one), i have tried multiple times to make a clean re-install of cordova , each time with "npm uninstall -g cordova", "npm cache clean", but it was not working . today i have tried again, but this time, in addition to this, i have manualy deleted the .cordova folder in my User folder, and it works ! so my conclusion is that something went wrong when the .cordova folder have been created (maybe a first run without the admin rights) and then this folder is never updated , even when uninstalling and cleaning cache (maybe i miss an option).
          Hide
          Lisa Seacat DeLuca added a comment -

          Amza MarianI added platform-tools as well, same problem.

          Show
          Lisa Seacat DeLuca added a comment - Amza Marian I added platform-tools as well, same problem.
          Hide
          tex added a comment -

          Lisa Seacat DeLuca your path is missing the android platform-tools , maybe it can help.
          cc Filip Maj

          Show
          tex added a comment - Lisa Seacat DeLuca your path is missing the android platform-tools , maybe it can help. cc Filip Maj
          Hide
          Filip Maj added a comment -

          Hmmm but you are using the adt-bundle whereas I am using the sdk.. I wonder if that could be it.

          Show
          Filip Maj added a comment - Hmmm but you are using the adt-bundle whereas I am using the sdk.. I wonder if that could be it.
          Hide
          Lisa Seacat DeLuca added a comment -

          Yes, points to the tools directory which has the android.bat file. I can also run "android" from a command line and it opens the sdk manager.

          Here's my Path variable:

          C:\workspaces\cordovacli\helloworld>set Path
          Path=C:\Program Files\nodejs;C:\IBM\android\adt-bundle-windows-x86_64\sdk\tools;C:\Users\IBM_ADMIN\git;C:\Program Files (x86)\Java\Java60;C:\IBM\OpenS
          ource\Git\cmd;C:\IBM\OpenSource\Git\bin;C:\IBM\OpenSource\nodejs\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\
          ;C:\ant\bin;C:\Program Files\nodejs\;C:\Users\IBM_ADMIN\AppData\Roaming\npm
          PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

          Show
          Lisa Seacat DeLuca added a comment - Yes, points to the tools directory which has the android.bat file. I can also run "android" from a command line and it opens the sdk manager. Here's my Path variable: C:\workspaces\cordovacli\helloworld>set Path Path=C:\Program Files\nodejs;C:\IBM\android\adt-bundle-windows-x86_64\sdk\tools;C:\Users\IBM_ADMIN\git;C:\Program Files (x86)\Java\Java60;C:\IBM\OpenS ource\Git\cmd;C:\IBM\OpenSource\Git\bin;C:\IBM\OpenSource\nodejs\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\ ;C:\ant\bin;C:\Program Files\nodejs\;C:\Users\IBM_ADMIN\AppData\Roaming\npm PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
          Hide
          Filip Maj added a comment -

          Lisa, as per the requirements laid out in the README for Android, do you have the android executable on your PATH?

          Show
          Filip Maj added a comment - Lisa, as per the requirements laid out in the README for Android, do you have the android executable on your PATH?
          Hide
          Lisa Seacat DeLuca added a comment -

          Running with the -d flag I get:

          C:\workspaces\cordovacli\helloworld>cordova -d platform add android
          cordova library for "android" already exists. No need to download. Continuing.
          Checking if platform "android" passes minimum requirements...
          Checking Android requirements...
          Running "android list target" (output to follow)

          undefined

          Show
          Lisa Seacat DeLuca added a comment - Running with the -d flag I get: C:\workspaces\cordovacli\helloworld>cordova -d platform add android cordova library for "android" already exists. No need to download. Continuing. Checking if platform "android" passes minimum requirements... Checking Android requirements... Running "android list target" (output to follow) undefined
          Hide
          tex added a comment -

          i have tried to clean all that was possible : npm cache clean, npm uninstall -g cordova , nodejs uninstall

          then install again , i did not get any error message (i get the classics "No repository field" warnings and a "npm WARN engine ncallbacks@1.0.0: wanted

          {"node":"~0.6.7"}

          (current:

          {"node":"v0.10.12","npm":"1.2.32"}

          )")

          and ... still the same issue, it looks like my system is screwed somewhere :/

          Show
          tex added a comment - i have tried to clean all that was possible : npm cache clean, npm uninstall -g cordova , nodejs uninstall then install again , i did not get any error message (i get the classics "No repository field" warnings and a "npm WARN engine ncallbacks@1.0.0: wanted {"node":"~0.6.7"} (current: {"node":"v0.10.12","npm":"1.2.32"} )") and ... still the same issue, it looks like my system is screwed somewhere :/
          Hide
          tex added a comment -

          Filip Maj same issue with C: drive.
          Could it be possible that something went wrong with my nodejs install ? i ran all scripts and starts nodejs prompt with administrator rights, but maybe that doe's not operate as good than with a real sudo on linux systems ?
          I'll try to make a clean uninstall and restart from begining.

          Show
          tex added a comment - Filip Maj same issue with C: drive. Could it be possible that something went wrong with my nodejs install ? i ran all scripts and starts nodejs prompt with administrator rights, but maybe that doe's not operate as good than with a real sudo on linux systems ? I'll try to make a clean uninstall and restart from begining.
          Hide
          Filip Maj added a comment -

          It's definitely a create script issue, judging by the stack trace. It fails at the read method, which is used in two spots:

          1. Reading in the VERSION file, like you mentioned Michael Brooks.
          2. Used for replacing certain tokens like package ID and name, which as done at the end of the create script.

          You may be right Mike. It looks like the key thing is the call to create does so cross-drive:

          Running bin/create for platform "android" with command: ""C:\Users\Tex\.cordova\
          lib\android\cordova\2.9.0\bin\create" "E:\repositories\test\platforms\android"
          "io.cordova.hellocordova" "HelloCordova"" (output to follow)
          C:\Users\Tex\.cordova\lib\android\cordova\2.9.0\bin\create.js(54, 5) Erreur d'ex
          ecution Microsoft JScript: Fichier introuvable
          

          That is, the drive of the library is different from the drive of the project.

          tex, can you try creating a cordova project on your C: drive instead of on your E: drive and see if you get the same issue?

          Show
          Filip Maj added a comment - It's definitely a create script issue, judging by the stack trace. It fails at the read method, which is used in two spots: 1. Reading in the VERSION file , like you mentioned Michael Brooks . 2. Used for replacing certain tokens like package ID and name, which as done at the end of the create script . You may be right Mike. It looks like the key thing is the call to create does so cross-drive: Running bin/create for platform "android" with command: ""C:\Users\Tex\.cordova\ lib\android\cordova\2.9.0\bin\create " " E:\repositories\test\platforms\android" "io.cordova.hellocordova" "HelloCordova" " (output to follow) C:\Users\Tex\.cordova\lib\android\cordova\2.9.0\bin\create.js(54, 5) Erreur d'ex ecution Microsoft JScript: Fichier introuvable That is, the drive of the library is different from the drive of the project. tex , can you try creating a cordova project on your C: drive instead of on your E: drive and see if you get the same issue?
          Hide
          Michael Brooks added a comment -

          Arg! Android builds successfully on my Windows 7 Ultimate N (64bit).

          I also tried projects with special characters, such as capitals, dots, and dashes.

          Do you guys see anything else unique with tex's stack trace? E: perhaps?

          Show
          Michael Brooks added a comment - Arg! Android builds successfully on my Windows 7 Ultimate N (64bit). I also tried projects with special characters, such as capitals, dots, and dashes. Do you guys see anything else unique with tex 's stack trace? E: perhaps?
          Hide
          Filip Maj added a comment -

          You are clearly a better man than I.

          Show
          Filip Maj added a comment - You are clearly a better man than I.
          Hide
          Michael Brooks added a comment -

          I'm also downloading a Win7 image, but it will take me a while to setup the VM and try to reproduce the issue.

          Windows!!!!!

          Show
          Michael Brooks added a comment - I'm also downloading a Win7 image, but it will take me a while to setup the VM and try to reproduce the issue. Windows!!!!!
          Hide
          Filip Maj added a comment -

          Benn can you take a look, as our resident Windows maestro?

          Show
          Filip Maj added a comment - Benn can you take a look, as our resident Windows maestro?
          Hide
          Michael Brooks added a comment -

          Additional details can be found on mwbrooks/phonegap-cli#77.

          My naive guess is that the create script is trying to find is VERSION and failing because ROOT is set to the app project directory instead of the Android framework directory. A quick fix would be to shell.cd into the Android framework. However, I cannot reproduce the error, so I'd be blindly patching it.

          Show
          Michael Brooks added a comment - Additional details can be found on mwbrooks/phonegap-cli#77 . My naive guess is that the create script is trying to find is VERSION and failing because ROOT is set to the app project directory instead of the Android framework directory. A quick fix would be to shell.cd into the Android framework. However, I cannot reproduce the error, so I'd be blindly patching it.
          Hide
          tex added a comment -

          got a similar issue running as administrator on win7 64 :

          > cordova platform add android

          "Error: The provided path "E:\repositories\test\platforms\android" is not an Android project."

          with -d i get :

          cordova library for "android" already exists. No need to download. Continuing.
          Checking if platform "android" passes minimum requirements...
          Checking Android requirements...
          Running "android list target" (output to follow)
          Available Android targets:
          ----------
          id: 1 or "android-8"
          Name: Android 2.2
          Type: Platform
          API level: 8
          Revision: 3
          Skins: HVGA, QVGA, WQVGA400, WQVGA432, WVGA800 (default), WVGA854
          ABIs : armeabi
          ----------
          id: 2 or "Google Inc.:Google APIs:8"
          Name: Google APIs
          Type: Add-On
          Vendor: Google Inc.
          Revision: 2
          Description: Android + Google APIs
          Based on Android 2.2 (API level 8)
          Libraries:

          • com.google.android.maps (maps.jar)
            API for Google Maps
            Skins: WVGA854, WQVGA400, HVGA, WQVGA432, WVGA800 (default), QVGA
            ABIs : armeabi
            ----------
            id: 3 or "KYOCERA Corporation:DTS Add-On:8"
            Name: DTS Add-On
            Type: Add-On
            Vendor: KYOCERA Corporation
            Revision: 1
            Description: DTS Add-On
            Based on Android 2.2 (API level 8)
            Libraries:
          • com.kyocera.dualscreen (dualscreen.jar)
            Dual Screen optional platform library
            Skins: DTS400 (default), WVGA854, WQVGA400, HVGA, DTS800, WQVGA432, WVGA800
            , QVGA
            ABIs : armeabi
            ----------
            id: 4 or "LGE:Real3D Add-On:8"
            Name: Real3D Add-On
            Type: Add-On
            Vendor: LGE
            Revision: 1
            Description: Real3D add-on
            Based on Android 2.2 (API level 8)
            Libraries:
          • com.lge.real3d (real3d.jar)
            Real3D library
            Skins: WVGA854, WQVGA400, Optimus3D (default), HVGA, WQVGA432, WVGA800, QVG
            A
            ABIs : armeabi
            ----------
            id: 5 or "Samsung Electronics Co., Ltd.:GALAXY Tab Addon:8"
            Name: GALAXY Tab Addon
            Type: Add-On
            Vendor: Samsung Electronics Co., Ltd.
            Revision: 1
            Based on Android 2.2 (API level 8)
            Skins: WVGA854, WQVGA400, GALAXY Tab (default), HVGA, WQVGA432, WVGA800, QV
            GA
            ABIs : armeabi
            ----------
            id: 6 or "android-15"
            Name: Android 4.0.3
            Type: Platform
            API level: 15
            Revision: 3
            Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
            XGA720, WXGA800
            ABIs : armeabi-v7a, mips, x86
            ----------
            id: 7 or "Google Inc.:Google APIs:15"
            Name: Google APIs
            Type: Add-On
            Vendor: Google Inc.
            Revision: 2
            Description: Android + Google APIs
            Based on Android 4.0.3 (API level 15)
            Libraries:
          • com.google.android.media.effects (effects.jar)
            Collection of video effects
          • com.android.future.usb.accessory (usb.jar)
            API for USB Accessories
          • com.google.android.maps (maps.jar)
            API for Google Maps
            Skins: WVGA854, WQVGA400, WSVGA, WXGA720, HVGA, WQVGA432, WVGA800 (default)
            , QVGA, WXGA800
            ABIs : armeabi-v7a
            ----------
            id: 8 or "Motorola Mobility, LLC.:ICS_R2:15"
            Name: ICS_R2
            Type: Add-On
            Vendor: Motorola Mobility, LLC.
            Revision: 2
            Description: Android 4.0.4 phone
            Based on Android 4.0.3 (API level 15)
            Skins: WVGA854, WQVGA400, WSVGA, WXGA720, HVGA, ATRIX-HD (default), WQVGA43
            2, WVGA800, QVGA, WXGA800
            ABIs : armeabi-v7a
            ----------
            id: 9 or "android-16"
            Name: Android 4.1.2
            Type: Platform
            API level: 16
            Revision: 4
            Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
            XGA720, WXGA800, WXGA800-7in
            ABIs : armeabi-v7a, mips, x86
            ----------
            id: 10 or "Google Inc.:Google APIs:16"
            Name: Google APIs
            Type: Add-On
            Vendor: Google Inc.
            Revision: 3
            Description: Android + Google APIs
            Based on Android 4.1.2 (API level 16)
            Libraries:
          • com.google.android.media.effects (effects.jar)
            Collection of video effects
          • com.android.future.usb.accessory (usb.jar)
            API for USB Accessories
          • com.google.android.maps (maps.jar)
            API for Google Maps
            Skins: WVGA854, WQVGA400, WSVGA, WXGA800-7in, WXGA720, HVGA, WQVGA432, WVGA
            800 (default), QVGA, WXGA800
            ABIs : armeabi-v7a
            ----------
            id: 11 or "android-17"
            Name: Android 4.2.2
            Type: Platform
            API level: 17
            Revision: 2
            Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
            XGA720, WXGA800, WXGA800-7in
            ABIs : armeabi-v7a
            ----------
            id: 12 or "Google Inc.:Google APIs:17"
            Name: Google APIs
            Type: Add-On
            Vendor: Google Inc.
            Revision: 2
            Description: Android + Google APIs
            Based on Android 4.2.2 (API level 17)
            Libraries:
          • com.google.android.media.effects (effects.jar)
            Collection of video effects
          • com.android.future.usb.accessory (usb.jar)
            API for USB Accessories
          • com.google.android.maps (maps.jar)
            API for Google Maps
            Skins: WVGA854, WQVGA400, WSVGA, WXGA800-7in, WXGA720, HVGA, WQVGA432, WVGA
            800 (default), QVGA, WXGA800
            ABIs : armeabi-v7a

          Running "android update project -p "C:\Users\Tex\.cordova\lib\android\cordova\2.
          9.0\framework" -t android-17" (output to follow)...
          Updated project.properties
          Updated local.properties
          build.xml: Found version-tag: custom. File will not be updated.
          Updated file C:\Users\Tex\.cordova\lib\android\cordova\2.9.0\framework\proguard-
          project.txt

          Running bin/create for platform "android" with command: ""C:\Users\Tex\.cordova\
          lib\android\cordova\2.9.0\bin\create" "E:\repositories\test\platforms\android"
          "io.cordova.hellocordova" "HelloCordova"" (output to follow)
          C:\Users\Tex\.cordova\lib\android\cordova\2.9.0\bin\create.js(54, 5) Erreur d'ex
          ecution Microsoft JScript: Fichier introuvable

          Error: The provided path "E:\repositories\test\platforms\android" is not an Andr
          oid project.
          at Object.android_parser (C:\Users\Tex\AppData\Roaming\npm\node_modules\cord
          ova\src\metadata\android_parser.js:35:15)
          at C:\Users\Tex\AppData\Roaming\npm\node_modules\cordova\src\prepare.js:67:2
          3
          at Array.map (native)
          at Object.prepare (C:\Users\Tex\AppData\Roaming\npm\node_modules\cordova\src
          \prepare.js:65:30)
          at C:\Users\Tex\AppData\Roaming\npm\node_modules\cordova\src\platform.js:235
          :47
          at C:\Users\Tex\AppData\Roaming\npm\node_modules\cordova\node_modules\shellj
          s\shell.js:1707:7
          at ChildProcess.exithandler (child_process.js:635:7)
          at ChildProcess.EventEmitter.emit (events.js:98:17)
          at maybeClose (child_process.js:735:16)
          at Process.ChildProcess._handle.onexit (child_process.js:802:5)

          ----------------------------------------------------------------------

          it seems that the problem is located here :

          C:\Users\Tex\.cordova\lib\android\cordova\2.9.0\bin\create.js(54, 5) Erreur d'ex
          ecution Microsoft JScript: Fichier introuvable

          the french message says : "Microsoft JScript execution error: File Not Found"

          Show
          tex added a comment - got a similar issue running as administrator on win7 64 : > cordova platform add android "Error: The provided path "E:\repositories\test\platforms\android" is not an Android project." with -d i get : cordova library for "android" already exists. No need to download. Continuing. Checking if platform "android" passes minimum requirements... Checking Android requirements... Running "android list target" (output to follow) Available Android targets: ---------- id: 1 or "android-8" Name: Android 2.2 Type: Platform API level: 8 Revision: 3 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WVGA800 (default), WVGA854 ABIs : armeabi ---------- id: 2 or "Google Inc.:Google APIs:8" Name: Google APIs Type: Add-On Vendor: Google Inc. Revision: 2 Description: Android + Google APIs Based on Android 2.2 (API level 8) Libraries: com.google.android.maps (maps.jar) API for Google Maps Skins: WVGA854, WQVGA400, HVGA, WQVGA432, WVGA800 (default), QVGA ABIs : armeabi ---------- id: 3 or "KYOCERA Corporation:DTS Add-On:8" Name: DTS Add-On Type: Add-On Vendor: KYOCERA Corporation Revision: 1 Description: DTS Add-On Based on Android 2.2 (API level 8) Libraries: com.kyocera.dualscreen (dualscreen.jar) Dual Screen optional platform library Skins: DTS400 (default), WVGA854, WQVGA400, HVGA, DTS800, WQVGA432, WVGA800 , QVGA ABIs : armeabi ---------- id: 4 or "LGE:Real3D Add-On:8" Name: Real3D Add-On Type: Add-On Vendor: LGE Revision: 1 Description: Real3D add-on Based on Android 2.2 (API level 8) Libraries: com.lge.real3d (real3d.jar) Real3D library Skins: WVGA854, WQVGA400, Optimus3D (default), HVGA, WQVGA432, WVGA800, QVG A ABIs : armeabi ---------- id: 5 or "Samsung Electronics Co., Ltd.:GALAXY Tab Addon:8" Name: GALAXY Tab Addon Type: Add-On Vendor: Samsung Electronics Co., Ltd. Revision: 1 Based on Android 2.2 (API level 8) Skins: WVGA854, WQVGA400, GALAXY Tab (default), HVGA, WQVGA432, WVGA800, QV GA ABIs : armeabi ---------- id: 6 or "android-15" Name: Android 4.0.3 Type: Platform API level: 15 Revision: 3 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W XGA720, WXGA800 ABIs : armeabi-v7a, mips, x86 ---------- id: 7 or "Google Inc.:Google APIs:15" Name: Google APIs Type: Add-On Vendor: Google Inc. Revision: 2 Description: Android + Google APIs Based on Android 4.0.3 (API level 15) Libraries: com.google.android.media.effects (effects.jar) Collection of video effects com.android.future.usb.accessory (usb.jar) API for USB Accessories com.google.android.maps (maps.jar) API for Google Maps Skins: WVGA854, WQVGA400, WSVGA, WXGA720, HVGA, WQVGA432, WVGA800 (default) , QVGA, WXGA800 ABIs : armeabi-v7a ---------- id: 8 or "Motorola Mobility, LLC.:ICS_R2:15" Name: ICS_R2 Type: Add-On Vendor: Motorola Mobility, LLC. Revision: 2 Description: Android 4.0.4 phone Based on Android 4.0.3 (API level 15) Skins: WVGA854, WQVGA400, WSVGA, WXGA720, HVGA, ATRIX-HD (default), WQVGA43 2, WVGA800, QVGA, WXGA800 ABIs : armeabi-v7a ---------- id: 9 or "android-16" Name: Android 4.1.2 Type: Platform API level: 16 Revision: 4 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W XGA720, WXGA800, WXGA800-7in ABIs : armeabi-v7a, mips, x86 ---------- id: 10 or "Google Inc.:Google APIs:16" Name: Google APIs Type: Add-On Vendor: Google Inc. Revision: 3 Description: Android + Google APIs Based on Android 4.1.2 (API level 16) Libraries: com.google.android.media.effects (effects.jar) Collection of video effects com.android.future.usb.accessory (usb.jar) API for USB Accessories com.google.android.maps (maps.jar) API for Google Maps Skins: WVGA854, WQVGA400, WSVGA, WXGA800-7in, WXGA720, HVGA, WQVGA432, WVGA 800 (default), QVGA, WXGA800 ABIs : armeabi-v7a ---------- id: 11 or "android-17" Name: Android 4.2.2 Type: Platform API level: 17 Revision: 2 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W XGA720, WXGA800, WXGA800-7in ABIs : armeabi-v7a ---------- id: 12 or "Google Inc.:Google APIs:17" Name: Google APIs Type: Add-On Vendor: Google Inc. Revision: 2 Description: Android + Google APIs Based on Android 4.2.2 (API level 17) Libraries: com.google.android.media.effects (effects.jar) Collection of video effects com.android.future.usb.accessory (usb.jar) API for USB Accessories com.google.android.maps (maps.jar) API for Google Maps Skins: WVGA854, WQVGA400, WSVGA, WXGA800-7in, WXGA720, HVGA, WQVGA432, WVGA 800 (default), QVGA, WXGA800 ABIs : armeabi-v7a Running "android update project -p "C:\Users\Tex\.cordova\lib\android\cordova\2. 9.0\framework" -t android-17" (output to follow)... Updated project.properties Updated local.properties build.xml: Found version-tag: custom. File will not be updated. Updated file C:\Users\Tex\.cordova\lib\android\cordova\2.9.0\framework\proguard- project.txt Running bin/create for platform "android" with command: ""C:\Users\Tex\.cordova\ lib\android\cordova\2.9.0\bin\create" "E:\repositories\test\platforms\android" "io.cordova.hellocordova" "HelloCordova"" (output to follow) C:\Users\Tex\.cordova\lib\android\cordova\2.9.0\bin\create.js(54, 5) Erreur d'ex ecution Microsoft JScript: Fichier introuvable Error: The provided path "E:\repositories\test\platforms\android" is not an Andr oid project. at Object.android_parser (C:\Users\Tex\AppData\Roaming\npm\node_modules\cord ova\src\metadata\android_parser.js:35:15) at C:\Users\Tex\AppData\Roaming\npm\node_modules\cordova\src\prepare.js:67:2 3 at Array.map (native) at Object.prepare (C:\Users\Tex\AppData\Roaming\npm\node_modules\cordova\src \prepare.js:65:30) at C:\Users\Tex\AppData\Roaming\npm\node_modules\cordova\src\platform.js:235 :47 at C:\Users\Tex\AppData\Roaming\npm\node_modules\cordova\node_modules\shellj s\shell.js:1707:7 at ChildProcess.exithandler (child_process.js:635:7) at ChildProcess.EventEmitter.emit (events.js:98:17) at maybeClose (child_process.js:735:16) at Process.ChildProcess._handle.onexit (child_process.js:802:5) ---------------------------------------------------------------------- it seems that the problem is located here : C:\Users\Tex\.cordova\lib\android\cordova\2.9.0\bin\create.js(54, 5) Erreur d'ex ecution Microsoft JScript: Fichier introuvable the french message says : "Microsoft JScript execution error: File Not Found"
          Hide
          Filip Maj added a comment -

          I've confirmed that this runs as desired on a Windows 8 machine..

          Judging by the error message, it looks like you are getting permission errors to the C:\Users\me\.cordova\lib\android\cordova\2.9.0\cordova-android-2.9.0-df1536e\test location.

          You can also try running the same command with a -d flag at the start to get more verbose output, this way we'll have a better idea of where it failed, i.e.

          cordova -d platform add android

          Show
          Filip Maj added a comment - I've confirmed that this runs as desired on a Windows 8 machine.. Judging by the error message, it looks like you are getting permission errors to the C:\Users\me\.cordova\lib\android\cordova\2.9.0\cordova-android-2.9.0-df1536e\test location. You can also try running the same command with a -d flag at the start to get more verbose output, this way we'll have a better idea of where it failed, i.e. cordova -d platform add android

            People

            • Assignee:
              Filip Maj
              Reporter:
              Lisa Seacat DeLuca
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development