gpt4 book ai didi

python - Buildozer 如何解决 "--ndk-api=21"错误

转载 作者:行者123 更新时间:2023-12-01 07:29:59 27 4
gpt4 key购买 nike

我有一个基于 kivy-python 的 Android 小应用程序。要将其转换为 APK,我必须使用 buildozer。

当我运行最后一步时:

buildozer android debug deploy run 我收到此错误。

我更改了规范文件中的 NDK 值,或者更改了代码。简而言之,我所做的就是查看类似的错误。我尝试了报告的解决方案,但它们不起作用。我什至不知道问题出在哪里。

相关日志:

[WARNING]: Missing executable: pkg-config is not installed
[WARNING]: Missing executable: libtoolize is not installed
[INFO]: -> running autogen.sh
working: /home/abra/DeskException in thread background thread for pid 3917:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self._target(*self.args, **self._kwargs)
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 1540, in wrap
fn(*args, **kwargs)
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 2459, in background_thread
handle_exit_code(exit_code)
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 2157, in fn
return self.command.handle_command_exit_code(exit_code)
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
raise exc
ErrorReturnCode_127:

RAN: /home/abra/Desktop/questionapp/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh

STDOUT:
/home/abra/Desktop/questionapp/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh: 2: exec: autoreconf: not found


STDERR:


Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"_main_", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1189, in <module>
main()
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1183, in main
ToolchainCL()
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 666, in _init_
getattr(self, args.subparser_name.replace('-', '_'))(args)
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 152, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 205, in build_dist_from_args
args, "ignore_setup_py", False
File "pythonforandroid/build.py", line 557, in build_recipes
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/libffi/_init_.py", line 33, in build_arch
shprint(sh.Command('./autogen.sh'), _env=env)
File "pythonforandroid/logger.py", line 178, in shprint
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 863, in next
self.wait()
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 792, in wait
self.handle_command_exit_code(exit_code)
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_127:

RAN: /home/abra/Desktop/questionapp/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh

STDOUT:
/home/abra/Desktop/questionapp/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh: 2: exec: autoreconf: not found


STDERR:

# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/abra/Desktop/questionapp/.buildozer/android/platform/build" --ndk-api=21
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

最佳答案

我解决了这个问题。如果有人遇到这个错误,我按照以下步骤解决了

sudo apt update

sudo apt-get install autoconf

pip install --upgrade buildozer

sudo apt install -y git zip unzip openjdk-8-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5

pip3 install --user --upgrade cython virtualenv

关于python - Buildozer 如何解决 "--ndk-api=21"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57254023/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com