Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using buildozer android debug #1112

Closed
Steelplate opened this issue May 18, 2020 · 6 comments
Closed

Error when using buildozer android debug #1112

Steelplate opened this issue May 18, 2020 · 6 comments

Comments

@Steelplate
Copy link

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

@aca00
Copy link

aca00 commented May 19, 2020

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

@tshirtman
Copy link
Member

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.

@Nibla1997
Copy link

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?

@baalexey
Copy link

Nibla, try to find .buildozer directory...

@Joker-jiajiahui
Copy link

步骤 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…

@misl6
Copy link
Member

misl6 commented Nov 12, 2022

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 misl6 closed this as completed Nov 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants