1

For packining I used instrumentalities which are recommended in kivy manual I use for kivy packing virtual machine from https://kivy.org/#download (Oracle virtual box and settings of virtual machine) For buildozer installating I used process https://github.com/kivy/buildozer, for Python 3. I manualy added to buildozer.spec file lines:

requirements = python3crystax,kivy
android.ndk_path = ~/buildozer/crystax-ndk
log_level = 2

Packing is described by next text:

. . .
. . .
. . .
[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

My question: Why is used python 2.7, if I used buildozer installation for python 3? Is it source my problems?

aL_eX
  • 1,453
  • 2
  • 15
  • 30
jasan
  • 209
  • 4
  • 15

1 Answers1

0

Buildozer is a Python module that does some actions to pack your app. This module being run by Python version it installed to. In your case you has Python 2 with buildozer installed to it.

Requirements in buildozer.spec have nothing to do with your current environment. This requirements says to buildozer which recipes/modules it should download, compile if needed and pack inside your Android app. python3crystax means that buildozer will pack Python 3 located in Crystax NDK (and already compiled for Android) inside your Android app to run it's code.

Mikhail Gerasimov
  • 36,989
  • 16
  • 116
  • 159
  • @ Thanks! I forgot that to use virtual machine, I installed python 3 and result is the same as in my guestion. Must I install kivy too? – jasan Jan 04 '18 at 20:01
  • @jasan you mean you want to run buildozer using Python 3? You should [install pip3](https://stackoverflow.com/a/13001357/1113207) and install buildozer for python 3: `sudo pip3 install buildozer`. And run it: `python3 -m buildozer android debug`. But I'm not 100% sure about last command, I also didn't ever try buildozer under Python 3 myself. – Mikhail Gerasimov Jan 04 '18 at 20:26
  • @ Mikhail, code I wrote for python 3.4. Buildozer is installed for python 3 (here https://github.com/kivy/buildozer), python for virtual machine was installed with command: python3 setup.py build – jasan Jan 04 '18 at 20:47
  • @ Mikhail, are you busy, or my question is bad and has not answer? – jasan Jan 06 '18 at 21:40
  • 1
    @jasan I guess I just missed notification, sorry. Ok, you installed python 3 and buildozer for it, did you try run it with `python3 -m buildozer android debug`? – Mikhail Gerasimov Jan 07 '18 at 11:21
  • @ Mikhail, your last advices didn't help me. I think about two next ways: using own virtual machine for python 3 (no preprepared) or overwriting code to python 2.7. I'll send you my experiencies. Thank You! – jasan Jan 07 '18 at 19:13