Search code examples
pythonandroidandroid-ndkkivybuildozer

Creating APK with Buildozer on a Raspberry Pi


I am trying to compile my kivy script into an apk. The only Linux PC I have is my Raspberry pi, so I already fought several problems, but I'm stuck with this one.

While compiling the following error occurs:

# Recommended android's NDK version by p4a is: 19b
# Android NDK is missing, downloading
# Downloading https://dl.google.com/android/repository/android-ndk-r19b-linux-x86.zip
Traceback (most recent call last):
  File "/usr/local/bin/buildozer", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/dist-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/usr/local/lib/python3.5/dist-packages/buildozer/__init__.py", line 1071, in run_command
    self.target.run_commands(args)
  File "/usr/local/lib/python3.5/dist-packages/buildozer/target.py", line 92, in run_commands
    func(args)
  File "/usr/local/lib/python3.5/dist-packages/buildozer/target.py", line 102, in cmd_debug
    self.buildozer.prepare_for_build()
  File "/usr/local/lib/python3.5/dist-packages/buildozer/__init__.py", line 178, in prepare_for_build
    self.target.install_platform()
  File "/usr/local/lib/python3.5/dist-packages/buildozer/targets/android.py", line 666, in install_platform
    self._install_android_ndk()
  File "/usr/local/lib/python3.5/dist-packages/buildozer/targets/android.py", line 459, in _install_android_ndk
    cwd=self.buildozer.global_platform_dir)
  File "/usr/local/lib/python3.5/dist-packages/buildozer/__init__.py", line 699, in download
    urlretrieve(url, filename, report_hook)
  File "/usr/lib/python3.5/urllib/request.py", line 1760, in retrieve
    block = fp.read(bs)
  File "/usr/lib/python3.5/tempfile.py", line 622, in func_wrapper
    return func(*args, **kwargs)
ValueError: read of closed file

What should I do to fix this?


Solution

  • It's an option in the buildozer.spec. 19c should be fine. You can also download it directly from google and tell buildozer where it is.