buildozer icon indicating copy to clipboard operation
buildozer copied to clipboard

Error when using buildozer android debug

Open steelplate02 opened this issue 4 years ago • 4 comments

Versions

  • Python: 3
  • OS: Raspian
  • Buildozer:

Description

I am trying to run the android debug however it keeps having an error at a specific point and I can find a solution on the internet that works. I have a very simple app that I would like to put on a cheap android table as a part of a fathers day gift and I never expected that the hardest part of making it would be downloading the thing. This is the first time I am using Kivy and Buildozer, so any help in avoiding or solving this error would be greatly appreciated!

Terminal

Command:

pi@raspberrypi:~/Desktop/Scoreboard_Controller $ buildozer android debug deploy run
Output:

# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Read available permissions from api-versions.xml
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian 'dpkg' package management program version 1.19.7 (armhf).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /home/pi/.local/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-8-openjdk-armhf/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-8-openjdk-armhf/jre/bin/keytool
# Install platform
# Run '/usr/bin/python3 -m pip install -q --user \'appdirs\' \'colorama>=0.3.3\' \'jinja2\' \'six\' \'enum34; python_version<"3.4"\' \'sh>=1.10; sys_platform!="nt"\' \'pep517<0.7.0"\' \'toml\''
# Cwd None
# Apache ANT found at /home/pi/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/pi/.buildozer/android/platform/android-sdk
# Android NDK is missing, downloading
# Downloading https://dl.google.com/android/repository/android-ndk-r17c-linux-x86.zip
Traceback (most recent call last):
  File "/usr/local/bin/buildozer", line 11, in <module>
    load_entry_point('buildozer', 'console_scripts', 'buildozer')()
  File "/home/pi/.local/lib/python3.7/site-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/home/pi/.local/lib/python3.7/site-packages/buildozer/__init__.py", line 1062, in run_command
    self.target.run_commands(args)
  File "/home/pi/.local/lib/python3.7/site-packages/buildozer/target.py", line 92, in run_commands
    func(args)
  File "/home/pi/.local/lib/python3.7/site-packages/buildozer/target.py", line 102, in cmd_debug
    self.buildozer.prepare_for_build()
  File "/home/pi/.local/lib/python3.7/site-packages/buildozer/__init__.py", line 186, in prepare_for_build
    self.target.install_platform()
  File "/home/pi/.local/lib/python3.7/site-packages/buildozer/targets/android.py", line 597, in install_platform
    self._install_android_ndk()
  File "/home/pi/.local/lib/python3.7/site-packages/buildozer/targets/android.py", line 394, in _install_android_ndk
    cwd=self.buildozer.global_platform_dir)
  File "/home/pi/.local/lib/python3.7/site-packages/buildozer/__init__.py", line 707, in download
    urlretrieve(url, filename, report_hook)
  File "/usr/lib/python3.7/urllib/request.py", line 1817, in retrieve
    block = fp.read(bs)
  File "/usr/lib/python3.7/tempfile.py", line 620, in func_wrapper
    return func(*args, **kwargs)
ValueError: read of closed file

steelplate02 avatar May 18 '20 17:05 steelplate02

I encountered this error and fixed it in the following way. Step1: Download android-ndk-r17c-linux-x86.zip manually from https://developer.android.com/ndk/downloads/older_releases

Step2: Extract files and move the files to /home/<user_name>/.buildozer/android/platform/ That's it.. Now re-run the code.

Note: This worked on ubuntu 18.xx and I am not sure about Raspian

aca00 avatar May 19 '20 13:05 aca00

this won't work on a raspberry pi.

It's maybe possible to run buildozer to build apks on a raspberry pi but:

  • it's not going to be easy, and the normal documentation certainly won't work, you'll have to do a lot of things manually, and you'll get seldom help
  • if you get it to work, building your distribution will take an aweful lot of time, it can easily take 20mn on a normal desktop, i imagine it's going to take hours on these low powered machines.

tshirtman avatar May 19 '20 15:05 tshirtman

I encountered this error and fixed it in the following way. Step1: Download android-ndk-r17c-linux-x86.zip manually from https://developer.android.com/ndk/downloads/older_releases

Step2: Extract files and move the files to /home/aca/.buildozer/android/platform/ Thats it.. Now re run the code.

Note: This worked on ubuntu 18.xx and I am not sure about Raspian

I have the same problem and did the things above. But i can't find a path "/home/aca/.buildozer/android/platform/". where should i move the files to?

Nibla1997 avatar Jul 29 '20 07:07 Nibla1997

Nibla, try to find .buildozer directory...

baalexey avatar Oct 25 '20 20:10 baalexey

步骤 1:从**https://developer.android.com/ndk/downloads/older_releases手动下载 android-ndk-r17c-linux-x86.zip

**步骤2:**提取文件并将文件移动到/home/aca/.buildozer/android/platform/ 多数民众赞成它..现在重新运行代码。

我使用ubuntu18 尝试了上述方法 但错误还是一样,怎么办 Uploading image.png…

Joker-jiajiahui avatar Nov 11 '22 05:11 Joker-jiajiahui

Closing this issue as Google only provides support for x86_64 on Linux), making the RaspberryPi` unusable as a build tool.

Hopefully, in the future, aarch64 will take a lead also on Linux laptops, making life easier for RaspberryPi users.

misl6 avatar Nov 12 '22 09:11 misl6