Using python3 in android using buildozer

I wrote a small program in python 3 and kivy. Now I want to create .apk using buildozer and test the application on my Android phone. Everything worked, and I was able to install the application on the phone, but the application crashed at startup.

The error log showed that the python apk environment was python 2.7 instead of 3. So my question is: is it possible to build apk with buildozer using python 3 environment on android? Or do I need to rewrite the application in python2? Is there a possible hack to force buildozer to use python3?

Edit: I followed the steps suggested by inclement and received the following error:

 Traceback (most recent call last):
File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
  "__main__", fname, loader, pkg_name)
File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
  exec code in run_globals
File "/home/micha/python/ZugGit/ZugAppFahrt/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 747, in <module>
  main()
File "/home/micha/python/ZugGit/ZugAppFahrt/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 744, in main
  ToolchainCL()
File "/home/micha/python/ZugGit/ZugAppFahrt/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 323, in __init__
  getattr(self, args.command)(unknown)
File "/home/micha/python/ZugGit/ZugAppFahrt/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 105, in wrapper_func
  build_dist_from_args(ctx, dist, dist_args)
File "/home/micha/python/ZugGit/ZugAppFahrt/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 142, in build_dist_from_args
  build_recipes(build_order, python_modules, ctx)
File "pythonforandroid/build.py", line 560, in build_recipes
  recipe.build_arch(arch)
File "pythonforandroid/recipe.py", line 910, in build_arch
  self.build_cython_components(arch)
File "pythonforandroid/recipe.py", line 919, in build_cython_components
  command = sh.Command('python{}'.format(self.ctx.python_recipe.version))
File "/usr/lib/python2.7/site-packages/sh.py", line 788, in __init__
  raise CommandNotFound(path)
sh.CommandNotFound: python3.5
# Command failed: python -m pythonforandroid.toolchain create --dist_name=zugFart --bootstrap=sdl2 --requirements=kivy==1.9.1,python3crystax --arch armeabi-v7a --copy-libs

Edit 2: This seems to be an endless story. When installing python3.5, I ran into this error:

collect2: error: ld returned 1 exit status
error: command 'arm-linux-androideabi-gcc' failed with exit status 1

, , python2.7, , , , , .: -)

- , ?

: - python 2.7. , : , buildozer. " ".

, , - :-) , .

+5
3

, buildozer python3, python-for-android . python-for-android, buildozer android_new target (buildozer android_new debug). buildozer python3, python3crystax ( python2, ), CrystaX NDK NDK buildozer, . kivy==1.9.1 , kivy.

Python3 , python2 , . python3, .

: script py2/py3, unicode, , , python2. , , , "", .

+3

( ), kivy python 3.5 , 3.4; , ; - , ...; buildozer, kivy-; , , shebang ( )

0

Readme 2018 . python3, buildozer , pip:

https://github.com/kivy/buildozer/

I would like to include assembly instructions, but they may change after a few months

0
source

All Articles