Error adding android platform


#1

Tried adding android platform and got this error:

C:\Users\Satellite\myapp>ionic platform add android
Creating android project…
Error: C:\Users\Satellite.cordova\lib\android\cordova\3.5.0\bin\create.bat: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\Satellite\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Process.ChildProcess._handle.onexit (child_process.js:822:5)
Error from platform command.

Retraced my steps in installation - I’m fairly certain the paths and environment variables are correct.

Tried to run ant and got the following error:

Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre8\li
b\tools.jar
Buildfile: build.xml does not exist!
Build failed

Any help would be appreciated…

Thanks


#2

When using cordova platform add android I get this:
C:\Users\Satellite\myApp>cordova platform add android
Creating android project…

C:\Users\Satellite.cordova\lib\android\cordova\3.5.0\bin\node_modules\q\q.js:12
6
throw e;
^
Error: Please install Android target 19 (the Android newest SDK). Make sure you
have the latest Android tools installed as well. Run “android” from your command
-line to install/update any missing SDKs or tools.
at C:\Users\Satellite.cordova\lib\android\cordova\3.5.0\bin\lib\check_reqs.
js:80:29
at _fulfilled (C:\Users\Satellite.cordova\lib\android\cordova\3.5.0\bin\nod
e_modules\q\q.js:798:54)
at self.promiseDispatch.done (C:\Users\Satellite.cordova\lib\android\cordov
a\3.5.0\bin\node_modules\q\q.js:827:30)
at Promise.promise.promiseDispatch (C:\Users\Satellite.cordova\lib\android
cordova\3.5.0\bin\node_modules\q\q.js:760:13)
at C:\Users\Satellite.cordova\lib\android\cordova\3.5.0\bin\node_modules\q
q.js:574:44
at flush (C:\Users\Satellite.cordova\lib\android\cordova\3.5.0\bin\node_mod
ules\q\q.js:108:17)
at process._tickCallback (node.js:419:13)
Error: C:\Users\Satellite.cordova\lib\android\cordova\3.5.0\bin\create.bat: Com
mand failed with exit code 8
at ChildProcess.whenDone (C:\Users\Satellite\AppData\Roaming\npm\node_module
s\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Process.ChildProcess._handle.onexit (child_process.js:822:5)


#3

uh… tits for halp?


#5

OK, I checked my own android install base. I even have not installed any API Level 19 stuff.
The command

ionic platform add android

works here.

You could try to update ionic cli

npm update -g cordova ionic

Is it a new app? If so, your Android Manifest needs to be updated, cause your platform tools now have Level 20. Or your environment variables are outdated.