Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kivy Buildozer VM sh.ErrorReturnCode_127 error

Tags:

kivy

buildozer

I am trying to build a simple Python program to an APK with Buildozer on the Kivy Virtual Machine. Every time I run buildozer android debug, I get the following error

pid 2134:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 2459, in    background_thread
    handle_exit_code(exit_code)
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 815, in     handle_command_exit_code
raise exc
ErrorReturnCode_127: 

  RAN: /home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform        /build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh

  STDOUT:
/home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform/build    /build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh: 2:     exec: autoreconf: not found


  STDERR:


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 "/home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform    /python-for-android/pythonforandroid/toolchain.py", line 1073, in <module>
    main()
  File "/home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1067, in main
    ToolchainCL()
  File "/home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 576, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 151, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 200, in     build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "pythonforandroid/build.py", line 562, in build_recipes
  File "/home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/libffi/__init__.py", line 33, in     build_arch
    shprint(sh.Command('./autogen.sh'), _env=env)
  File "pythonforandroid/logger.py", line 178, in shprint
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 863, in next
    self.wait()
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 792, in wait
    self.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python2.7/dist-packages/sh.py", line 815, in     handle_command_exit_code
    raise exc
sh.ErrorReturnCode_127: 

  RAN: /home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh

  STDOUT:
/home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform/build    /build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh: 2:     exec: autoreconf: not found


  STDERR:

# Command failed: /usr/bin/python -m pythonforandroid.toolchain create         --dist_name=kivytest --bootstrap=sdl2 --requirements=python3,kivy --arch         armeabi-v7a --copy-libs --color=always --storage-dir="/home/kivy/Desktop    /Projects/Kivy_Test/.buildozer/android/platform/build" --ndk-api=21
# 
# 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

Note: my log_level in my buildozer.spec is 2. I have tried to install some dependencies, but the Kivy VM does not let me for whatever reason. If anyone could help me out, that would be great!

like image 697
SomeMosa Avatar asked Oct 17 '25 10:10

SomeMosa


1 Answers

I had the same issue and in my case i was missing the following system dependencies that are require for python-for-android as described in the file:python-for-android file

The dependencies i was missing:

  • automake
  • autoconf
  • libltdl-dev

I found that solution in the Github forum of Buildozer: Github Question

So you are probably missing some dependencies as well. For me running the following commands worked perfectly:

sudo apt-get install automake
sudo apt-get install autoconf
sudo apt-get install libltdl-dev
like image 181
Lucas Ramos Avatar answered Oct 21 '25 08:10

Lucas Ramos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!