0

I am running the Android tool to create the package definition, as follows:

/Users/sanjiban/Library/Android/sdk/tools/android update project --path /private/var/folders/1s/3x07dzvn3tvcc1qwprhntgxr74gm0x/T/tmp33oiu6zl/ --target android-25 --name QtApp

but that gives me the error:

Building Android package using ant.
Using ant: /usr/local/Cellar/ant/1.10.1/bin/ant
Buildfile: build.xml does not exist!
Build failed
Building the android package failed!

As per this post, that command "android update project.." itself should create the needed build.xml even if it does not exist, isn't that correct? If yes, why does it not work here? If no, where am I going wrong?

Notes:

  • OS: macOS Sierra
  • "whereis ant": returns nothing
  • "which ant": returns "/usr/local/bin/ant"
  • "echo $ANT": returns "/usr/local/Cellar/ant/1.10.1/bin/ant"
  • When I try to do the same thing after setting $ANT to "/usr/local/bin/ant", I get same error (except the path of ant used of course)

Can you help me regarding how to fix this issue? Any help would be highly encouraged.

Sanjiban Bairagya
  • 704
  • 2
  • 12
  • 33
  • "where am I going wrong?" -- you are attempting to use Ant for Android app development, and Ant has not been officially supported in 2-3 years. – CommonsWare Jun 04 '17 at 14:02
  • not officially supported in general, or only in Mac? – Sanjiban Bairagya Jun 04 '17 at 14:07
  • Not officially supported in general. Google officially supports Gradle. – CommonsWare Jun 04 '17 at 14:33
  • Could be. But ant still exists and it still does what it was created for, right? In that context, leaving beside whether it is official or not, I was wondering what am I doing wrong in what I mentioned in my post. – Sanjiban Bairagya Jun 04 '17 at 15:03
  • You are assuming that `android update project` generates Ant `build.xml` files. Your error message is: `build.xml does not exist!`. This would suggest that `android update project` is not creating this file (and that it had not previously existed in your project). – CommonsWare Jun 04 '17 at 15:24
  • Can you see the following [accepted answer](https://stackoverflow.com/a/5572439/5254764) answered in a similar post? It says there that executing the command "android update project.." "will create the needed build.xml within the example directory". Am I doing something different here? – Sanjiban Bairagya Jun 04 '17 at 15:29
  • That answer was from 2011. In 2011, Ant was the official command-line build solution supported by Google. It is now 2017, six years later. Ant is no longer the official command-line build solution supported by Google. Hence, it is not terribly surprising that `android update project` does not necessarily generate a `build.xml` file. Since the `android` command is deprecated, I cannot get `android update project` to even *run*, let alone generate a `build.xml` file. – CommonsWare Jun 04 '17 at 15:35
  • with SDK 25.3.0 Google has removed And scripts completely from SDK – V-master Jun 05 '17 at 07:20

0 Answers0