{{ help }} ANT PROBLEM? Unable to resolve project target 'android-19'

Yes, i have problem too. I want to emulate android, and i have all things installed.

When i was checking all thing i see this:

$ ant -v
Apache Ant(TM) version 1.9.4 compiled on April 29 2014
Trying the default build file: build.xml
Buildfile: build.xml does not exist!
Build failed``

And my project, didn’t emulate:

$ ionic emulate android
Running command: /Users/hermes/www/todo/hooks/after_prepare/010_add_platform_class.js     /Users/hermes/www/todo
add to body class: platform-android
Running command:     /Users/hermes/www/todo/hooks/after_prepare/020_remove_sass_from_platforms.js     /Users/hermes/www/todo
Running command: /Users/hermes/www/todo/platforms/android/cordova/run --emulator
Buildfile: /Users/hermes/www/todo/platforms/android/build.xml



 [checkenv] Android SDK Tools Revision 24.0.2
 [checkenv] Installed at /Users/hermes/Library/Android/sdk

 [echo] Project Name: CordovaApp
  [gettype] Project Type: Application




[getbuildtools] Using latest Build Tools: 21.1.2
 [echo] Resolving Build Target for CordovaApp...

/Users/hermes/Library/Android/sdk/tools/ant/build.xml:542: Unable to resolve project target 'android-19'**

Total time: 1 second

                throw e;
Error code 1 for command: ant with args: debug,-    f,/Users/hermes/www/todo/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: /Users/hermes/www/todo/platforms/android/cordova/run: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1008:16)
at Process.ChildProcess._handle.onexit (child_process.js:1080:5)

I have the API 19, see the image bellow:

Any idea how can i solve this?

1 Like

I tested with genymotion, but didn’t work too :frowning: Help me please.


Please, Anyone can help me?

Up. I’m still with same problem.

Hi zerutreck, i had the same problem and i solved it.
The problem was that the apache ant folder were placed in “Programs File(x86)”. In windows os this folder is protected, so you need the administrator permission to use the file inside that folder.
Verify if your ant folder is placed in these folder and change the position.
The problem is that Git Bash or other programs for launch the app build tries to access to the folder for the build, but they have not the permission. So they are blocked. If you use a cmd with administrator permission (on windows), it work.