I'm using the new (master) branch of python-for-android (at commit 93728aa), on top of a clean, up-to-date install of Debian jessie; all package dependencies are installed as listed in the p4a readme docs. I'm finding the error shown below.
I see the same error (below) whether I call p4a directly, or if I use buildozer to call it (via "android_new"). The old-toolchain of python-for-android works fine on this system to produce APKs. The error below seems strange to me, as the command being called by p4a:
/opt/android-sdk-linux/tools/ant debug
doesn't seem right to me (more below).
Here's my call to p4a:
p4a apk --sdk_dir /opt/android-sdk-linux --ndk_dir /opt/android-ndk-r10e \
--android_api 15 --ndk_ver r10e-rc4 --private /root/HelloWorld \
--package=org.hw.helloworld --name="HelloWorld" \
--version=0.5 --bootstrap=pygame --requirements=sdl,python2 \
--dist_name=helloworld
Here's some initial logging output from p4a showing things going well:
[INFO]: This python-for-android revamp is an experimental alpha release!
[INFO]: It should work (mostly), but you may experience missing features or bugs.
[INFO]: Will compile for the following archs: armeabi
[INFO]: Getting Android API version from user argument
[INFO]: Available Android APIs are (15)
[INFO]: Requested API target 15 is available, continuing.
[INFO]: Getting NDK dir from from user argument
[INFO]: Got NDK version from from user argument
[INFO]: Using Google NDK r10e-rc4
[INFO]: Found virtualenv at /usr/local/bin/virtualenv
[INFO]: Found the following toolchain versions: ['4.8', '4.9', 'clang3.5', 'clang3.6']
[INFO]: Picking the latest gcc toolchain, here 4.9
[INFO]: Of the existing distributions, the following meet the given requirements:
[INFO]: helloworld: includes recipes (hostpython2, pygame_bootstrap_components, python2, sdl, six, pygame, pyjnius, android, kivy), built for archs (armeabi)
[INFO]: helloworld has compatible recipes, using this one
[INFO]: Of the existing distributions, the following meet the given requirements:
[INFO]: helloworld: includes recipes (hostpython2, pygame_bootstrap_components, python2, sdl, six, pygame, pyjnius, android, kivy), built for archs (armeabi)
[INFO]: helloworld has compatible recipes, using this one
[INFO]: -> directory context /root/.local/share/python-for-android/dists/helloworld
<snip>
Here's the relevant snippet of log output showing the error:
[INFO]: -> running ant debug
[INFO]: STDOUT:
Traceback (most recent call last):
File "/usr/local/bin/p4a", line 9, in <module>
load_entry_point('python-for-android==0.3', 'console_scripts', 'p4a')()
File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 708, in main
ToolchainCL()
File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 323, in __init__
getattr(self, args.command)(unknown)
File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 106, in wrapper_func
func(self, args)
File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 556, in apk
shprint(sh.ant, 'debug', _tail=20, _critical=True)
File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/logger.py", line 164, in shprint
output = command(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/sh.py", line 769, in __call__
return RunningCommand(cmd, call_args, stdin, stdout, stderr)
File "/usr/lib/python2.7/dist-packages/sh.py", line 327, in __init__
self.call_args, pipe=pipe)
File "/usr/lib/python2.7/dist-packages/sh.py", line 891, in __init__
os.execv(cmd[0], cmd)
OSError: [Errno 13] Permission denied
[INFO]: STDERR:
[INFO]: COMMAND:
cd /root/.local/share/python-for-android/dists/helloworld && /opt/android-sdk-linux/tools/ant debug
[WARNING]: ERROR: /opt/android-sdk-linux/tools/ant failed!
But, the command being executed ("/opt/android-sdk-linux/tools/ant") is referencing what is the ant *DIRECTORY*, not any ant executable (so the permission denied error message is unsurprising). At least that's the internal structure of the Android SDK (r24.4.1) I downloaded and extracted earlier today:
root@laptop:~# ls -d /opt/android-sdk-linux/tools/ant/*
/opt/android-sdk-linux/tools/ant/build.xml
/opt/android-sdk-linux/tools/ant/NOTICE
/opt/android-sdk-linux/tools/ant/uibuild.xml
I've tried to run p4a as both root, and as a normal user, just to see if it mattered (it did not, as I'd suspected).
I searched online, both in Kivy/P4A google groups and elsewhere, and couldn't find any mention of this issue. Any input is very welcome.
Thanks!