I am trying to create an Android project with Cordova, however i am getting an ENOENT error although i followed the tutorial step by step very carefully, this is getting me angry.
First this is the screenshot of the error:
Here are information about my software and hardware/os:
Hardware and OS:
Intel(R) Core(TM) i5-3230M CPU # 2.60 GHz 2.60GHz
4 GB RAM
64 bit operating system, x 64 based processor
Windows 8
Software:
Here are some of the outputs of my command line for the related software.
$ npm -version
Output: 1.4.8
$ cordova -version
Output: 3.4.1-0.1.0
$ ant -version
Output: Apache Ant(TM) Version 1.9.3 compiled on December 23 2013
$ java -version
$ adb version
Output: Android Debug Bridge version 1.0.31
Here are some of my system variables:
ANDROID_HOME: C:\adt-bundle-windows-x86_64-20140321\sdk
ANT_HOME: C:\apache-ant-1.9.3
JAVA_HOME: C:\Program Files\Java\jdk1.8.0_05
CLASSPATH: %JAVA_HOME%\jre\lib
PATH:
%JAVA_HOME%\bin;C:\app\barisa\product\11.2.0\dbhome_1\bin;C:\Program
Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS
Client\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program
Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program
Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program
Files (x86)\Intel\Intel(R) Management Engine
Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management
Engine Components\IPT;C:\Program Files\Microsoft\Web Platform
Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web
Pages\v1.0\;c:\Program Files (x86)\Microsoft SQL
Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL
Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL
Server\100\DTS\Binn\;C:\Program Files (x86)\Windows Kits\8.0\Windows
Performance Toolkit\;C:\Program Files (x86)\Microsoft SQL
Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL
Server\90\Tools\binn\;C:\Program Files (x86)\Microsoft SQL
Server\90\Tools\binn\;C:\Program Files (x86)\Microsoft SQL
Server\90\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL
Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files
(x86)\Microsoft Visual Studio
8\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL
Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files
(x86)\Microsoft Visual Studio
9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL
Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL
Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL
Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL
Server\110\Tools\Binn\ManagementStudio\;C:\Program Files
(x86)\Microsoft Visual Studio
10.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL
Server\110\DTS\Binn\;%ANT_HOME%\bin;C:\adt-bundle-windows-x86_64-20140321\sdk\platform-tools;C:\adt-bundle-windows-x86_64-20140321\sdk\tools;C:\Program
Files\nodejs\
Note: I copied the tools.jar from jdk/lib to jre/lib after some
research on the internet. Not working.
Note 2: I give the command "cd
C:\Users\barisa.cordova\lib\android\cordova\3.4.0\bin" There is a
check_reqs file in that folder. However if i type $ chek_reqs in the
command line it says "check_reqs is not recognized as an internal or
external command ...."
Note 3: I opened command propmt (cmd) by right click -> run as
administrator What should i do?
Extra information with -d flag:
Update
I cleaned .cordova and reinstalled it and now, i am getting this error:
My variables are defined as indicated above.
If you are sure of yours paths try to type android in cmd if it says: 'xcopy' was not recognized.
then add to your path:
%SystemRoot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem;
In certain cases, don't forget to reboot the PC.
In my case I just needed to add "C:\Windows\System32" to my windows path.
I had a similar issue when trying ionic platform add android.
result;
partial build with ENOENT error titled "cordova-plugin-console" on the same child process as mentioned above superspawn.js
After trying reinstalling etc.. without resolution I changed my path variables around.
ANDROID_HOME was placed in user variables --
C:\Users\XXXXXX\AppData\Local\Android\android-sdk
PATH was updated in the system variables to remove previous entries for SDK and added at the end;
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Windows\System32;C:\Users\XXXXXX\Node\;C:\Users\XXXXX\AppData\Local\Android\android-sdk\tools;C:\Users\XXXXXX\AppData\Local\Android\android-sdk\platform-tools;
Restart pc, tested with new app
ionic start <new folder> tabs
cd to the folder created,
test it runs with
ionic serve --lab
exit with q then try to add the platform.
ionic platform add android
now it works..
Please note********* now when i run 'android' in the CMD from my user dir...
C:\Users\XXXXX>android
i do not see the xcopy not found displayed to my screen.
android SDK manager always loaded before and still now after i changed my paths.
Hope this helps p.s I run these cmds from my user acc which is not the admin acc as i never log in as or use my pc as an administrator.
Make sure that if you created PATH as a system variable, you should run Command Prompt as administrator.
I created PATH as a user variable, and would get the same error when tryin to run as administrator.
Try to follow these steps:
run the command: npm uninstall cordova -g
delete the folder: C:\Users\your-name\.cordova
reinstall the cordova: npm install -g cordova
now go to the project folder and try again: cordova platform add android
In my case problem was user variable TEMP. There were two folders.
Not working TEMP -path:
%USERPROFILE%\AppData\Local\Temp;C:\php
Working TEMP -path:
%USERPROFILE%\AppData\Local\Temp
After this everything worked fine!
I had this exact same error days ago with cordova version 3.1.Go to directory path C:\Program Files\nodejs and then install your cordova.Sometimes cordova cannot connect to the right path of npm due to conflict.Then create your project and add platform android.Hope this solution works for you too.
I just run cmd with as Administrator and execute 'cordova platform add android' command and now work fine.
Related
I have installed IONIC and Cordova on my new laptop. Installed JAVA, Android etc.
When i try to add platform android, i get errors for all 4 plugins.
Error message is:
TypeError: version is longer than 256 characters
ionic cordova build android
[INFO] Enabling Cordova integration.
> ionic config set integrations.cordova {} --json --force
[OK] integrations.cordova set to {} in .\ionic.config.json!
> cordova platform add android --save
в Running command - failed!
[ERROR] Exception: Using cordova-fetch for cordova-android#~6.2.2
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: io.ionic.starter
Name: MyApp
Activity: MainActivity
Android target: android-25
Subproject Path: CordovaLib
Android project created with cordova-android#6.2.3
Discovered plugin "cordova-plugin-console" in config.xml. Adding it to the project
Installing "cordova-plugin-console" for android
Failed to install 'cordova-plugin-console': TypeError: version is longer than 256 characters
at new SemVer (C:\Users\hillesc\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\semver\semver.js:283:11)
at compare (C:\Users\hillesc\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\semver\semver.js:566:10)
at Function.gte (C:\Users\hillesc\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\semver\semver.js:615:10)
at C:\Users\hillesc\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:629:24
at _fulfilled (C:\app3\todo\platforms\android\cordova\node_modules\q\q.js:854:54)
at self.promiseDispatch.done (C:\app3\todo\platforms\android\cordova\node_modules\q\q.js:883:30)
at Promise.promise.promiseDispatch (C:\app3\todo\platforms\android\cordova\node_modules\q\q.js:816:13)
at C:\app3\todo\platforms\android\cordova\node_modules\q\q.js:624:44
at runSingle (C:\app3\todo\platforms\android\cordova\node_modules\q\q.js:137:13)
at flush (C:\app3\todo\platforms\android\cordova\node_modules\q\q.js:125:13)
Failed to restore plugin "cordova-plugin-console" from config.xml. You might need to try adding it again. Error: TypeError: version is longer than 256 characters
Running command: "C:\Program Files\nodejs\node.exe" C:\app3\todo\hooks\after_prepare\010_add_platform_class.js C:\app3\todo
add to body class: platform-android
--save flag or autosave detected
Saving android#~6.2.3 into config.xml file ...
ionic info
cli packages: (C:\Users\hillesc\AppData\Roaming\npm\node_modules)
#ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2
global packages:
Cordova CLI : 7.0.1
local packages:
Cordova Platforms : android C:\app3\todo>set cihdrive=c: C:\app3\todo>set cihdir=c:\cih C:\app3\todo>set servdir=c:\cih\service C:\app3\todo>path C:\Users\hillesc\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\hillesc\bin;C:\ProgramData\Oracle\Java\javapath;C:\xTools;C:\windows\SYSTEM32;C:\windows;C:\windows\SYSTEM32\WBEM;C:\windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\PROGRAM FILES (X86)\INTEL\SERVICES\IPT;C:\PROGRAM FILES (X86)\COMMON FILES\ULEAD SYSTEMS\MPEG;C:\Program Files\ThinkPad\Bluetooth Software;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn;C:\Program Files\Microsoft SQL Server\100\Tools\Binn;C:\Program Files\Microsoft SQL Server\100\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Common Files\Intuit\QBPOSSDKRuntime;C:\Program Files (x86)\Hyland\Web ActiveX;C:\Program Files\Microsoft System Center 2012 R2\Service Manager;C:\Program Files\Git\cmd;C:\Program Files\Java\jdk1.8.0_111\bin;C:\Program Files\nodejs;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Users\hillesc\AppData\Roaming\npm;C:\Program Files\Java\jdk1.8.0_111\bin;C:\Users\hillesc\AppData\Local\Android\sdk\tools;C:\Users\hillesc\AppData\Local\Android\sdk\platform-tools;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl;c:\cih\util 6.2.3
Ionic Framework : ionic1 1.3.3
System:
Android SDK Tools : 26.0.2
Node : v6.11.2
npm : 3.10.10
OS : Windows 7
Thanks for that comment Gandhi. Yes I found the problem, and it may help 1 person out of millions: I had a registry entry in HKLM\Software\Microsoft\Command Processor that automatically runs a job (a.bat, kind of like the old "autoexec.bat") that has the exact wierd SET commands in it.
Somehow the fact that this was running every time a command prompt opened, corrupted my platforms.
Once I took that out, everything looks normal now in the "platforms" part of the "ionic info" command. Thanks! (My colleague posted this question for me so I can't give points sorry).
I am downloaded Node.js and Apache Ant from Bitnami. And set Environmental Variables for the Android SDK, Java JDK, Apache ANT and for NODE.js.
I have checked the PATH by echo %PATH% command in CMD and it results as
C:\ProgramData\Oracle\Java\javapath;
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;
C:\Program Files (x86)\Windows Live\Shared;
C:\Program Files(x86)\WinSCP\;
C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;
C:\Program Files\Java\jdk1.8.0_74\bin;
C:\Bitnami\apache-ant-1.9.2-bin\apache-ant-1.9.2;
C:\Softwares\android-sdk_r24.0.2-windows\android-sdk-windows\tools;
C:\Softwares\android-sdk_r24.0.2-windows\android-sdk-windows\platform-tools;
C:\Bitnami\nodejs-0.12.2-0;
But it always showing like this,
C:>npm -v
'npm' is not recognized as an internal or external command,
operable program or batch file.
Please suggest for fixing this.
Thanks
Found it.
The path for npm and cordova are present in nodejs\node_modules folder. So refer all paths from use_nodejs file. Please follow the steps.
Open the Command Prompt from Windows. And type C:\>set. From this you can get all system Variables and paths.
Open the use_nodejs which is the windows batch file from C:\xxx\Bitnami\nodejs-0.12.2-0 and type C:\>set, from this you can get all system Variables and paths but which is looking different.
Compare the variables and paths from both command prompt and you can get ideas of paths.
Change the path in Windows Command Prompt like setx NODE_HOME "C:\Bitnami\nodejs-0.12.2-0\nodejs\node_modules" from the use_nodejs command promt paths. Like this change whatever paths you want to add.
I ran
cordova platform add android
and the error I got
Running command: "c:\Program Files\nodejs\node.exe" "d:\Users\Andy\Project
s\ionic-tut\hooks\before_platform_add\init_directories.js" "d:/Users/Andy/
Projects/ionic-tut"
Creating android project...
D:\Users\Andy\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\nod
e_modules\q\q.js:126
throw e;
^
Error: ANDROID_HOME is not set and "android" command not in your PATH. You must
fulfill at least one of these conditions.
I ran this from git bash
on running it from cmd it throws a different error
Error: Please install Android target "android-19".
I ran a echo %PATH% to verify:
C:\ProgramData\Oracle\Java\javapath;
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;
C:\Program Files (x86)\Intel\iCLS Client\;
C:\Program Files\Intel\iCLSClient\;
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86;
C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64;
C:\Program Files\Intel\WiFi\bin\;
C:\Program Files\Common Files\Intel\WirelessCommon\;
C:\Program Files\Intel
\Intel(R) Management Engine Components\DAL;
C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;
C:\HashiCorp\Vagrant\bin;
C:\Program Files\nodejs\;
D:\Users\Andy\AppData\Roaming\npm;C:/Program Files/nodejs/node.exe;
C:\Program FIles\Java\jdk1.8.0_31\bin;
C:\Program Files (x86)\Android\android-sdk\tools;C:\Program Files (x86)\Android\android-sdk\platform_tools
I feel like I am messing up the enviroment variables somewhere but I have checked it multiple times and it seems to be right.
What am I missing?
Windows 8.1
You will need to run the command android from CMD to open the android SDK manager.
From there make sure that the Android 4.4.2(19) package is installed. Let me know if this fixes your issue.
I have installed the Phonegap using
$ npm install -g PhoneGap
And I have created the Project too.
After that I did
$ PhoneGap build android
It gives
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
I am stuck with this screen for a lot of time.. I closed cmd and opened again and tried.. But again it stands on the same screen for lot of time..
I have installed Node.js and I have android SDk too. Please help
Thanks in advance..
EDIT:
I closed again and opened.. It gives
Error : C:\Users\Kutty.cordova\lib\npm_cache\cordova-android\3.6.3\package\bin\create.bat: command failed with exit code 8
Please help..
My Path : C:\Users\Kutty\AppData\Roaming\npm\;%ANT_HOME%\bin
A) Software required:
1) MAC : [For both iOS, Android]
a) Android Studios [For Android]
b) ANT 1.8.1
c) NODE.JS
d) Xcode 5.1 and above [for iOS]
2) Windows :
a) Eclipse ADT Latest [For Android]
b) ANT 1.8.1
c) NODE.JS
B) Steps to install Phonegap/Cordova:
1) MAC:
Open Terminal
a. Install Android Studios
Setup
your PATH environment variable on Mac OS
a. Open the Terminal program (this is in your Applications/Utilities folder by default).
i. Run the following command
$ touch ~/.bash_profile; open ~/.bash_profile
This will open the file in your default text editor.
You need to add the path to your Android SDK platform-tools and tools directory. In my example I will use "/Development/android-sdk-macosx" as the directory the SDK is installed in (For Android Studios, it can be found in /Users/<user>/Library/Android/sdk/ by default). Add the following line:
$ export PATH=${PATH}:/Development/android-sdk-macosx/platform- tools:/Development/android-sdk-macosx/tools
Save the file and quit the text editor.
Execute your .bash profile to update your PATH.
$ source ~/.bash_profile
Now every time you open the Terminal program your PATH will include the Android SDK
sudo npm install -g cordova
Create a new app
$ cordova create <directory name> <bundle identifier> <name of project>
$ cd <directory name>
$ cordova platform add android OR iOS
$ cordova run android OR iOS
If you come across problem of Please install Android target "android-19" then run android from Terminal. It will open up Android SDK manager and from there install Android 4.4.2 (API 19)
2) Windows:
Open Command prompt
a. Put ANT [Downloaded folder] folder into “android ADT folder”/sdk
Setup your PATH environment variable on Windows
From the Desktop, right-click My Computer and click Properties.
Click Advanced System Settings link in the left column.
In the System Properties window click the Environment Variables button.
Select the PATH variable from the System variables section.
Select the Edit button.
i. You need to add the path to your Android SDK platform-tools and tools directory. In my example I will use C:\Development\android-sdk- windows as the directory the SDK is installed in. Append the following text into the text box:
ii. ;C:\Development\android-sdk-windows\platform- tools;C:\Development\android-sdk-windows\tools
iii. Save your edit. Close the Environment Variables dialog.
Additionally, you may need to include %JAVA_HOME%\bin to your PATH as well. To check to see if this is required, run a command prompt and type java. If the program cannot be found add %JAVA_HOME%\bin to the PATH. You may need to specify the full path instead of using the %JAVA_HOME% environment variable.
Finally, you may need to include %ANT_HOME%\bin to your PATH as well. To check to see if this is required, run a command prompt and type ant. If the program cannot be found add %ANT_HOME%\bin to the PATH.
You may need to specify the full path instead of using the %ANT_HOME% environment variable.
sudo npm install -g cordova
Create a new app
$ cordova create <directory name> <bundle identifier> <name of project>
$ cd <directory name>
$ cordova platform add android
$ cordova run android
I also tried ,there is a problem in phonegap updated version .
run the following commands in command prompt
npm uninstall -g phonegap -> to unsinstall
npm install -gphonegap#4.2.0-0.24.2 -> to install specific version.
Now use whatever sdk you have,it will work.
PHONEGAP Manual Method
Another method is placing the things manually, and how it can be implemented is shown
below:
• set up the normal Android Application Project
• Create www folder inside assets
• download the phonegap zip file
• copy the phonegap jar file from downloaded phonegap place into libs folder
• copy the phonegap .js file from downloaded phonegap place into www folder that we
have created inside the assets.
• copy the xml complete folder and out into res folder of android
• create index.html file inside the www folder which is the gateway of the phonegap
application.
• Now we can transfer the control from MainActivity.java to our index.html which will
look like this:
"public class MainActivity extends DroidGap {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
}
}
• open the AndroidManifest.xml file and paste the code that is shown in the picture.
Figure 4.1: Android Manifest File which allows permissions for device usage.
41
After writing this code, now whatever we code in the index.html file will be shown on the
android emulator or the phone.
PHONEGAP CLI Method
Phonegap Command Line Interface(CLI) Method can be called as automated method because
commands will do all the work for you to initialize the PhoneGap project that we have to set up
by yourself in the manual method. Following are the steps that need to be followed in order to
set up the PhoneGap project:
Download Nod.js and install it.
• Now run this command "npm install -g cordova" on Node.js, this command will install
the cordova module with the help of Node Package Manager(npm) for windows, where
-g states that installation of cordova globally.
• Another command "cordova create first com.example.First FirstProgram", this command
will take little processing tim, the argument first will determine the directory of the
project, second argument com.example.First gets a package and the last argument
FirstProgram is define the application title.
• This command "cd first" will give the control inside the cordova project.
• Now this command "cordova platform add android" , it will set up the target platform
on which platform you want to install this application, other commands for several
platform are described below:
• Cordova platform add wp8cordova platform add windows
• cordova platform add amazon-fireos
• cordova platform add blackberry10
• cordova platform add Firefox's
• "cordova platforms ls" command will check the current platforms and we can also
delete the platform by "cordova platform rm amazon-fireos"
• Now the process come on the building block of application by running the command on
console " cordova emulate android".
42
• Finally this command will run the basic application "cordova run android" and the
settings of the folders like www in assets and all other things in AndroidManifest.html is
setup according to the phonegap project.
add android sdks 'tools' and 'platform-tools' to path variable.
Keep in mind if you have installed 'phonegap' always use 'phonegap' instead of 'cordova' anywhere.
I personally prefer using cordova.
I installed cordova e phonegap via npm install -g cordova and npm install -g phonegap respectively. Then i created a HelloWorld application via cordova create HelloWorld mynamespace.helloworld HelloWorld. It worked fine! Then i changed my working directory to HelloWorld and i tried to build the app for android via cordova platform add android -d but it didn't work. here is the output:
Installing cordova library for android...
Requesting {"uri":"https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=snapshot;h=3.3.0;sf=tgz"}...
Downloading cordova library for android...
Downloaded, unzipped and extracted 541065 byte response.
Download complete
Installing cordova library for android...
Checking if platform "android" passes minimum requirements...
Creating android project...
Running bin/create for platform "android" with command: ""C:\Users\marcos.pacheco\.cordova\lib\android\cordova\3.3.0\bin\create" "C:\Dev\HelloWorld\platforms\android" "mynamespace.helloworld" "HelloWorld"" (output to follow)
C:\Users\marcos.pacheco\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:126
throw e;
^
Error: An error occured during creation of android sub-project.
at C:\Users\marcos.pacheco\AppData\Roaming\npm\node_modules\cordova\src\platform.js:244:30
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've googled and have found some issues with whitespaces but my project is in the C:\Dev\HelloWorld path and my android sdk is in the PATH so that when i type adb at the windows prompt i get the help information of the command as well Java and Ant. Furthermore, i have ANT_HOME, JAVA_HOME and ANDROID_HOME set. I also deleted the ** .cordova ** folder inside my %HOMEPATH% directory and entered the command again but the error is still there.
What might be wrong?
XCOPY needs to be defined and found on your path as it is used by the internal node.js scripts to move things around.
You probably already have xcopy.exe somewhere on your machine. You should be able to add %SystemRoot%\System32 to your PATH and it will work. Or you can open up a terminal and type where xcopy to see the actual path to your xcopy.exe.
I guess having XCOPY on the path is a requirement for setting up and installing Android, but it'd be nice if Cordova checked to make sure you have XCOPY somewhere...