我准备使用kivy buildozer。对于安装,我使用了here的指令,进程为python 3.在第3步之后,buildozer.spec文件没有完成,检查行(步骤4)有下一个内容:
requirements = kivy
#android.ndk_path =
buildozer android debug deploy run之后的安装消息:
# Unpacking Android NDK
# Android NDK installation done.
# Check application requirements
# Check garden requirements
# Compile platform
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/media/sf_ForBuildozer/.buildozer/android/platform/build
#
# Buildozer failed to execute the last command
# If the error is not obvious, please raise the log_level to 2
# and retry the latest command.
# In case of a bug report, please add a full log with log_level = 2
问题的根源是什么?
我将log_level = 2添加到section buildozer,New message:
# Run '/usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/media/sf_ForBuildozer/.buildozer/android/platform/build'
# Cwd /media/sf_ForBuildozer/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]: Will compile for the following archs: armeabi-v7a
[INFO]: Found Android API target in $ANDROIDAPI
[INFO]: Available Android APIs are ()
[WARNING]: Requested API target 19 is not available, install it with the SDK android tool.
[WARNING]: Exiting.
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/media/sf_ForBuildozer/.buildozer/android/platform/build
#
# 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
我应用了米哈伊尔·格拉西莫夫的建议,并在短暂的步骤后获得了新的消息:
# Run '/usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/media/sf_ForBuildozer/.buildozer/android/platform/build'
# Cwd /media/sf_ForBuildozer/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]: Will compile for the following archs: armeabi-v7a
[INFO]: Found Android API target in $ANDROIDAPI
[INFO]: Available Android APIs are ()
[WARNING]: Requested API target 19 is not available, install it with the SDK android tool.
[WARNING]: Exiting.
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/media/sf_ForBuildozer/.buildozer/android/platform/build
这里的问题是SDK不包含为目标API构建的所有内容。通常buildozer自动处理它,但不时it breaks。您可以通过GUI手动安装东西(参见上面的链接)或者我通常通过(linux)控制台进行操作:
echo y | android-sdk-linux/tools/android update sdk --all --no-ui --filter tools
echo y | android-sdk-linux/tools/android update sdk --all --no-ui --filter platform-tools
echo y | android-sdk-linux/tools/android update sdk --all --no-ui --filter build-tools-27.0.2
echo y | android-sdk-linux/tools/android update sdk --all --no-ui --filter android-19
确保您的SDK目录在android-sdk-linux/tools/android
上可用。安装完所有这些之后我认为错误应该去了。