Skip to content

Commit d1ad0d6

Browse files
committed
Added check and error if ant is not available
1 parent d48b38a commit d1ad0d6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pythonforandroid/toolchain.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,15 @@ def apk(self, args):
712712
build_args = build.parse_args(args.unknown_args)
713713
self.hook("after_apk_build")
714714
self.hook("before_apk_assemble")
715-
output = shprint(sh.ant, args.build_mode, _tail=20, _critical=True, _env=env)
715+
716+
try:
717+
ant = sh.Command('ant')
718+
except sh.CommandNotFound:
719+
error('Could not find ant binary, please install it and make '
720+
'sure it is in your $PATH.')
721+
exit(1)
722+
723+
output = shprint(ant, args.build_mode, _tail=20, _critical=True, _env=env)
716724
self.hook("after_apk_assemble")
717725

718726
info_main('# Copying APK to current directory')

0 commit comments

Comments
 (0)