对于包装,我使用了kivy手册中推荐的乐器 我使用来自https://kivy.org/#download的kivy打包虚拟机(Oracle虚拟机和虚拟机的设置) 对于buildozer安装,我使用了进程https://github.com/kivy/buildozer,用于Python 3。 我manualy添加到buildozer.spec文件行:
requirements = python3crystax,kivy
android.ndk_path = ~/buildozer/crystax-ndk
log_level = 2
包装由下一个文字描述:
. . .
. . .
. . .
[INFO]: Unpacking sdl2_image for armeabi-v7a
[INFO]: -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.tar.gz
[INFO]: -> directory context /media/sf_ForBuildozer/.buildozer/android/platform/build/build/bootstrap_builds/sdl2_gradle-python3crystax/jni
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 "/media/sf_ForBuildozer/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 978, in <module>
main()
File "/media/sf_ForBuildozer/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 975, in main
ToolchainCL()
File "/media/sf_ForBuildozer/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 512, in __init__
getattr(self, args.subparser_name.replace('-', '_'))(args)
File "/media/sf_ForBuildozer/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 149, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/media/sf_ForBuildozer/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 193, in build_dist_from_args
build_recipes(build_order, python_modules, ctx)
File "pythonforandroid/build.py", line 559, in build_recipes
File "pythonforandroid/recipe.py", line 520, in prepare_build_dir
File "pythonforandroid/recipe.py", line 422, in unpack
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 1245, in __call__
return RunningCommand(cmd, call_args, stdin, stdout, stderr)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 633, in __init__
self.wait()
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 651, in wait
self.handle_command_exit_code(exit_code)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 672, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_2: <exception str() failed>
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3crystax,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
我的问题:为什么使用python 2.7,如果我使用buildozer安装python 3?这是我的问题吗?
答案 0 :(得分:0)
Buildozer是一个Python模块,可以执行一些操作来打包您的应用程序。该模块由安装的Python版本运行。在您的情况下,您安装了带有buildozer的Python 2。
buildozer.spec
中的要求与您当前的环境无关。这个要求告诉buildozer它应该下载的配方/模块,如果需要可以编译并打包到你的Android应用程序中。 python3crystax
means buildozer将在您的Android应用中包含位于Crystax NDK中的Python 3(并且已经针对Android编译)以运行它的代码。