虽然 运行 buildozer android debug deploy 运行 Android 缺少 NDK

While Running buildozer android debug deploy run Android NDK is missing

当我运行 "buildozer android debug deploy 运行"

# Downloading https://dl.google.com/android/repository/android-ndk-r19c-linux-x86.zip
Traceback (most recent call last):
  File "/home/appdeveloper/kivymdapp/venv/bin/buildozer", line 8, in <module>
sys.exit(main())
  File "/home/appdeveloper/kivymdapp/venv/lib/python3.9/site-packages/buildozer/scripts/client.py", line 13, in main
Buildozer().run_command(sys.argv[1:])
  File "/home/appdeveloper/kivymdapp/venv/lib/python3.9/site-packages/buildozer/__init__.py", line 1020, in run_command
self.target.run_commands(args)
  File "/home/appdeveloper/kivymdapp/venv/lib/python3.9/site-packages/buildozer/target.py", line 93, in run_commands
func(args)
  File "/home/appdeveloper/kivymdapp/venv/lib/python3.9/site-packages/buildozer/target.py", line 103, in cmd_debug
self.buildozer.prepare_for_build()
  File "/home/appdeveloper/kivymdapp/venv/lib/python3.9/site-packages/buildozer/__init__.py", line 170, in prepare_for_build
self.target.install_platform()
  File "/home/appdeveloper/kivymdapp/venv/lib/python3.9/site-packages/buildozer/targets/android.py", line 702, in install_platform
self._install_android_ndk()
  File "/home/appdeveloper/kivymdapp/venv/lib/python3.9/site-packages/buildozer/targets/android.py", line 492, in _install_android_ndk
self.buildozer.download(url,
  File "/home/appdeveloper/kivymdapp/venv/lib/python3.9/site-packages/buildozer/__init__.py", line 654, in download
urlretrieve(url, filename, report_hook)
  File "/usr/lib/python3.9/urllib/request.py", line 1847, in retrieve
block = fp.read(bs)
  File "/usr/lib/python3.9/tempfile.py", line 617, in func_wrapper
return func(*args, **kwargs)

ValueError:读取已关闭的文件

完整结果:

buildozer android debug deploy run

# 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.21.7 (arm64).
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/appdeveloper/kivymdapp/venv/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-17-openjdk-arm64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-17-openjdk-arm64/bin/keytool
# Install platform
# Run 'git config --get remote.origin.url'
# Cwd /home/appdeveloper/kivymdapp/demos/icons/.buildozer/android/platform/python-for-android
https://github.com/kivy/python-for-android.git
# Run 'git branch -vv'
# Cwd /home/appdeveloper/kivymdapp/demos/icons/.buildozer/android/platform/python-for-android
* master 227a7658 [origin/master] Merge pull request #2561 from misl6/release-2022.03.13
# Run '/home/appdeveloper/kivymdapp/venv/bin/python3 -m pip install -q  \'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/appdeveloper/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/appdeveloper/.buildozer/android/platform/android-sdk
# Recommended android's NDK version by p4a is: 19c
# Android NDK is missing, downloading
# Downloading https://dl.google.com/android/repository/android-ndk-r19c-linux-x86.zip
Traceback (most recent call last):
  File "/home/appdeveloper/kivymdapp/venv/bin/buildozer", line 8, in <module>
sys.exit(main())
  File "/home/appdeveloper/kivymdapp/venv/lib/python3.9/site-packages/buildozer/scripts/client.py", line 13, in main
Buildozer().run_command(sys.argv[1:])
  File "/home/appdeveloper/kivymdapp/venv/lib/python3.9/site-packages/buildozer/__init__.py", line 1020, in run_command
self.target.run_commands(args)
  File "/home/appdeveloper/kivymdapp/venv/lib/python3.9/site-packages/buildozer/target.py", line 93, in run_commands
func(args)
  File "/home/appdeveloper/kivymdapp/venv/lib/python3.9/site-packages/buildozer/target.py", line 103, in cmd_debug
self.buildozer.prepare_for_build()
  File "/home/appdeveloper/kivymdapp/venv/lib/python3.9/site-packages/buildozer/__init__.py", line 170, in prepare_for_build
self.target.install_platform()
  File "/home/appdeveloper/kivymdapp/venv/lib/python3.9/site-packages/buildozer/targets/android.py", line 702, in install_platform
self._install_android_ndk()
  File "/home/appdeveloper/kivymdapp/venv/lib/python3.9/site-packages/buildozer/targets/android.py", line 492, in _install_android_ndk
self.buildozer.download(url,
  File "/home/appdeveloper/kivymdapp/venv/lib/python3.9/site-packages/buildozer/__init__.py", line 654, in download
urlretrieve(url, filename, report_hook)
  File "/usr/lib/python3.9/urllib/request.py", line 1847, in retrieve
block = fp.read(bs)
  File "/usr/lib/python3.9/tempfile.py", line 617, in func_wrapper
return func(*args, **kwargs)

ValueError:读取已关闭的文件

请帮帮我!搜索小时和小时没有结果尝试了所有 android ndk 安装方法!没有结果

我正在使用安装在 raspberry pi 4 8gb ram

上的 kali linux arm64

感谢所有来访的人:)

I have solved it

I think the default google link is not working

"https://dl.google.com/android/repository/android-ndk-r19c-linux-x86.zip"

I manually installed android-ndk-r19c-linux-x86.zip

And moved the extracted file to /home/Username/.buildozer/android/platform

And edited my buildozer.spec file where it says

# (str) Android NDK directory (if empty, it will be automatically downloaded.)
android.ndk_path = /home/<Username>/.buildozer/android/platform/android-ndk-r19c

Pointing to the file where i have moved

And the problem is solved!