0
votes

I'm trying to add the android platform however this is the error message I keep getting

C:\Users\Xavier\Desktop\Mtek_DM\Mtek>cordova -d platform add android cordova library for "android" already exists. No need to download. Continuing. Checking if platform "android" passes minimum requirements... Creating android project... Running command: C:\Users\Xavier.cordova\lib\android\cordova\3.5.1\bin\create.b at --cli C:\Users\Xavier\Desktop\Mtek_DM\Mtek\platforms\android org.xtek.Mtek Mt ek

C:\Users\Xavier.cordova\lib\android\cordova\3.5.1\bin\node_modules\q\q.js:126 throw e; ^ Error: An error occurred while listing Android targets at C:\Users\Xavier.cordova\lib\android\cordova\3.5.1\bin\lib\check_reqs.js: 87:29 at _rejected (C:\Users\Xavier.cordova\lib\android\cordova\3.5.1\bin\node_mo dules\q\q.js:808:24) at C:\Users\Xavier.cordova\lib\android\cordova\3.5.1\bin\node_modules\q\q.j s:834:30 at Promise.when (C:\Users\Xavier.cordova\lib\android\cordova\3.5.1\bin\node _modules\q\q.js:1079:31) at Promise.promise.promiseDispatch (C:\Users\Xavier.cordova\lib\android\cor dova\3.5.1\bin\node_modules\q\q.js:752:41) at C:\Users\Xavier.cordova\lib\android\cordova\3.5.1\bin\node_modules\q\q.j s:574:44 at flush (C:\Users\Xavier.cordova\lib\android\cordova\3.5.1\bin\node_module s\q\q.js:108:17) at process._tickCallback (node.js:415:13) Command finished with error code 8: C:\Users\Xavier.cordova\lib\android\cordova \3.5.1\bin\create.bat --cli,C:\Users\Xavier\Desktop\Mtek_DM\Mtek\platforms\andro id,org.xtek.Mtek,Mtek Error: C:\Users\Xavier.cordova\lib\android\cordova\3.5.1\bin\create.bat: Comman d failed with exit code 8 at ChildProcess.whenDone (C:\Users\Xavier\AppData\Roaming\npm\node_modules\c ordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23) at ChildProcess.EventEmitter.emit (events.js:98:17) at maybeClose (child_process.js:743:16) at Process.ChildProcess._handle.onexit (child_process.js:810:5)

Furthermore, I created my System environments at

ANDROID_HOME =C:\Users\Xavier\Desktop\Android\sdk\platform-tools ANT_HOME = C:\Users\Xavier\Desktop\Android\apache_ant1.9.4 JAVA_HOME = C:\Program Files\Java\jdk1.7.0_21

And linked them under my variable PATH as

C:\Users\Xavier\AppData\Roaming\npm;%ANT_HOME%/bin;%ANDROID_HOME%/tools;%ANDROID_HOME%/platform-tools;%JAVA_HOME%/bin

Am I missing something? because when I typein java in the command line it works but for ant i get "buildfile: build.xml does not exist! build fail"

1
yup you need to install ant.Check this blog.Really helped you...simonmacdonald.blogspot.no/2012/11/…Talha Q
"buildfile: build.xml does not exist! build fail" doesn't mean that ant isn't working, just that it didn't find a build.xml file in the current directory.Mohamed AMAZIRH
I think ANDROID_HOME should point to \sdk`, not \sdk\platform-tools. This is because the build system uses things in both platform-tools, and tools`. Change that and try again in a new terminal window please.MBillau
Thank you @TalhaQ I will check out his blog.. but i do have Ant installed in the android directory (just to simplify things since idk whats it for)Xavier
@MBillau That works!! thanks wow.. that was really a silly mistake on my partXavier

1 Answers

1
votes

ANDROID_HOME should point to \sdk, not \sdk\platform-tools\. This is because the build system uses things in both platform-tools and tools folders. Change that and try again in a new terminal window please.