Kivy:Buildozer.spec文件未完成

时间:2017-12-31 14:23:13

标签: python kivy buildozer

我准备使用 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

问题的根源是什么?

我在 buildozer 部分添加了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
# 
# 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

1 个答案:

答案 0 :(得分:0)

问题在于SDK不包含为目标API构建的所有内容。通常,buildozer会自动处理它,但有时会it breaks。你可以通过GUI手动安装东西(参见上面的链接)或者我通常通过(linux)console安装它:

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处可用。 安装完所有这些之后,我认为错误应该发生。