Reputation: 524
Trying to run Kivy with buildozer on Ubuntu 16.04, (startup-demo-project pong) I get an error on command
buildozer android debug deploy
After: .... [DEBUG]: BUILD SUCCESSFUL ....
at the end of the build there is an error message:
....
IOError: [Errno 2] No such file or directory: u'/home/std/Dokumente/python
/Kivy/.buildozer/android/platform/build/dists/myapp/build/outputs
/apk/myapp-debug.apk'
My installation is according to: http://buildozer.readthedocs.io/en/latest/installation.html for Ubuntu 16.04.
Also buildozer serve does not show anything useful, only:
Directory listing for /
as response to call:
http://localhost:8000
Buildozer console says:
192.168.178.22 - - [15/Apr/2018 21:43:12] "GET / HTTP/1.1" 200 -
192.168.178.22 - - [15/Apr/2018 21:43:12] code 404, message File not found
Annotation: I changed the log_level = 2 for more information, but could not figure out where to find the relevant log file or where to get more information about the error.
Upvotes: 0
Views: 1234
Reputation: 16041
IOError: [Errno 2] No such file or directory: u'/home/std/Dokumente/python /Kivy/.buildozer/android/platform/build/dists/myapp/build/outputs /apk/myapp-debug.apk'
Use sudo to change and recompile android.py for Python 2.7. Please do the following at terminal window:
Change directory
cd /usr/local/lib/python2.7/dist-packages/buildozer/targets
Make backup copies of android.py and android.pyc
sudo cp android.py android-orig.py
sudo cp android.pyc android-orig.pyc
Use an editor to make changes to android.py
sudo gedit android.py
Insert the following import before import sys
from distutils.version import LooseVersion
Add the following codes after line 791 (# XXX found how the apk name is really built from the title
). Note: __sdk_dir (double underscore). Please refer to print screens below for details.
__sdk_dir = self.android_sdk_dir
build_tools_versions = os.listdir(join(__sdk_dir, 'build-tools'))
build_tools_versions = sorted(build_tools_versions, key=LooseVersion)
build_tools_version = build_tools_versions[-1]
gradle_files = ["build.gradle", "gradle", "gradlew"]
is_gradle_build = any((
exists(join(dist_dir, x)) for x in gradle_files)) and build_tools_version >= '25.0'
if is_gradle_build:
Save the changes.
Compile android.py
sudo python -m py_compile a--ndroid.py
sudo python
>>> import py_compile
>>> py_compile.compile('android.py')
At your project folder, run
buildozer android debug
Upvotes: 2