buildozer icon indicating copy to clipboard operation
buildozer copied to clipboard

Buildozer Error `ValueError: read of closed file`

Open TheDeaX-Lab opened this issue 6 years ago • 17 comments

Versions

  • Python: 3.7.1
  • OS: ArchLinux 4.19.4-arch1-1-ARCH
  • Kivy: 1.10.1
  • Cython: 0.29.1

Description

I compile my project "Hello world" and catch the error on the program Buildozer

buildozer.spec

buildozer.txt

Logs

# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Install platform
# Apache ANT found at /home/deax/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/deax/.buildozer/android/platform/android-sdk-20
# Android NDK is missing, downloading
Traceback (most recent call last):
  File "/usr/bin/buildozer", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python3.7/site-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/usr/lib/python3.7/site-packages/buildozer/__init__.py", line 1059, in run_command
    self.target.run_commands(args)
  File "/usr/lib/python3.7/site-packages/buildozer/target.py", line 92, in run_commands
    func(args)
  File "/usr/lib/python3.7/site-packages/buildozer/target.py", line 102, in cmd_debug
    self.buildozer.prepare_for_build()
  File "/usr/lib/python3.7/site-packages/buildozer/__init__.py", line 176, in prepare_for_build
    self.target.install_platform()
  File "/usr/lib/python3.7/site-packages/buildozer/targets/android.py", line 507, in install_platform
    self._install_android_ndk()
  File "/usr/lib/python3.7/site-packages/buildozer/targets/android.py", line 319, in _install_android_ndk
    cwd=self.buildozer.global_platform_dir)
  File "/usr/lib/python3.7/site-packages/buildozer/__init__.py", line 687, in download
    urlretrieve(url, filename, report_hook)
  File "/usr/lib/python3.7/urllib/request.py", line 1817, in retrieve
    block = fp.read(bs)
  File "/usr/lib/python3.7/tempfile.py", line 481, in func_wrapper
    return func(*args, **kwargs)
ValueError: read of closed file

TheDeaX-Lab avatar Dec 01 '18 11:12 TheDeaX-Lab

Download ndk manually then paste it in /home/deax/.buildozer/android/platform/ it should fix that error

codingsett avatar Dec 04 '18 20:12 codingsett

clear old buildozer files $rm -rf .buildozer uninstall latest version $pip uninstall buildozer cython install old stable version $pip install buildozer==0.34, cython==0.25.2 initialize buildozer and sdk $buildozer init && buildozer android adb -- version again remove .buildozer and upgrade to latest version $rm -rf .buildozer $pip install buildozer==0.37, cython==0.28.5 --upgrade use

homdx avatar Dec 06 '18 19:12 homdx

Looks like the NDK download URL has been a bit of a moving target.

two ways I was able to resolve this:

option 1) to get buildozer to perform the download for you by correcting the download URL: <PYTHON_INSTALL_DIR>/site_packages/buildozer/targets/android.py line 316 change the url from /repository/ to /ndk/ then rerun buildozer as normal and it detects that the NDK is missing and downloads it from the correct URL.

option 2) do the download by hand per codingsett's comment, but make sure you have the version that buildozer expects. In my case it wants r9c. So download http://dl.google.com/android/ndk/android-ndk-r9c-linux-x86_64.tar.bz2, and unzip it into the expected location, in this case ~/.buildozer/android/platform then run buildozer again as normal.

caver456 avatar Dec 09 '18 14:12 caver456

@TerryChan2003 Had this problem also, worked around by manually downloading the ndk and linking directly to it in the buildozer.spec file.

fr3nzy avatar Dec 24 '18 11:12 fr3nzy

i have segment error

[INFO]:    -> running make -j5                                                                                                                                                               
Exception in thread background thread for pid 20746:                                                                                                                                         
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.7/site-packages/sh.py", line 2170, in background_thread
    handle_exit_code(exit_code)
  File "/usr/lib/python3.7/site-packages/sh.py", line 1929, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/usr/lib/python3.7/site-packages/sh.py", line 672, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_2: 

  RAN: /usr/bin/make -j5

  STDOUT:
gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -o Modules/config.o Modules/config.c
gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -DPYTHONPATH='":plat-linux4:lib-tk:lib-old"' \
	-DPREFIX='"/usr/local"' \
	-DEXEC_PREFIX='"/usr/local"' \
	-DVERSION='"2.7"' \
	-DVPATH='""' \
	-o Modules/getpath.o ./Modules/getpath.c
In file included from Include/Python.h:126,
                 from Modules/config.c:19:
Include/modsupport.h:27:1: предупреждение: «PyArg_ParseTuple» некорректный вид функции форматирования [-Wformat=]
 PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
 ^~~~~~~~~~
In file included from Include/Python.h:126,
                 from ./Modules/getpath.c:3:
Include/modsupport.h:27:1: предупреждение: «PyArg_ParseTuple» некорректный вид функции форматирования [-Wformat=]
 PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
 ^~~~~~~~~~
./Modules/getpath.c: В функции «calculate_path»:
./Modules/getpath.c:497:17: предупреждение: «strncpy» output may be truncated copying 4096 bytes from a string of length 4096 [-Wstringop-truncation]
                 strncpy(argv0_path, tmpbuffer, MAXPATHLEN);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE \
      -DSVNVERSION="\"`LC_ALL=C echo Unversioned directory`\"" \
      -DHGVERSION="\"`LC_ALL=C `\"" \
      -DHGTAG="\"`LC_ALL=C `\"" \
      -DHGBRANCH="\"`LC_ALL=C `\"" \
      -o Modules/getbuildinfo.o ./Modules/getbuildinfo.c
In file included from Include/Python.h:126,
                 from ./Modules/getbuildinfo.c:1:
Include/modsupport.h:27:1: предупреждение: «PyArg_ParseTuple» некорректный вид функции форматирования [-Wformat=]
 PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
 ^~~~~~~~~~
rm -f libpython2.7.a
ar rc libpython2.7.a Modules/getbuildinfo.o
ar rc libpython2.7.a Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o Parser/parsetok.o Parser/bitset.o Parser/metagrammar.o Parser/firstsets.o Parser/grammar.o Parser/pgen.o Parser/myreadline.o Parser/tokenizer.o
ar rc libpython2.7.a Objects/abstract.o Objects/boolobject.o Objects/bufferobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/cobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/intobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/object.o Objects/obmalloc.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/stringobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/weakrefobject.o Objects/unicodeobject.o Objects/unicodectype.o
ar rc libpython2.7.a Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/bltinmodule.o Python/ceval.o Python/compile.o Python/codecs.o Python/errors.o Python/frozen.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/import.o Python/importdl.o Python/marshal.o Python/modsupport.o Python/mystrtoul.o Python/mysnprintf.o Python/peephole.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/dtoa.o Python/formatter_unicode.o Python/formatter_string.o Python/dynload_shlib.o   Python/thread.o
ar rc libpython2.7.a Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.o 
ar rc libpython2.7.a Modules/threadmodule.o  Modules/signalmodule.o  Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/zipimport.o  Modules/symtablemodule.o  Modules/arraymodule.o  Modules/cmathmodule.o  Modules/mathmodule.o  Modules/_struct.o  Modules/timemodule.o  Modules/operator.o  Modules/_weakref.o  Modules/_randommodule.o  Modules/_collectionsmodule.o  Modules/itertoolsmodule.o  Modules/stropmodule.o  Modules/_functoolsmodule.o  Modules/_elementtree.o  Modules/datetimemodule.o  Modules/_bisectmodule.o  Modules/fcntlmodule.o  Modules/selectmodule.o  Modules/socketmodule.o  Modules/md5module.o Modules/md5.o  Modules/shamodule.o  Modules/sha256module.o  Modules/sha512module.o  Modules/binascii.o  Modules/parsermodule.o  Modules/cStringIO.o  Modules/cPickle.o  Modules/zlibmodule.o  Modules/xmlparse.o Modules/xmlrole.o Modules/xmltok.o Modules/pyexpat.o  Modules/xxsubtype.o
ranlib libpython2.7.a
gcc -pthread  -Xlinker -export-dynamic -o python \
		Modules/python.o \
		libpython2.7.a -lpthread -ldl  -lutil -L/usr/local/lib -lz    -lm  
/usr/bin/ld: libpython2.7.a(posixmodule.o): in function `posix_tmpnam':
/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/./Modules/posixmodule.c:7370: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
/usr/bin/ld: libpython2.7.a(posixmodule.o): in function `posix_tempnam':
/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/./Modules/posixmodule.c:7317: warning: the use of `tempnam' is dangerous, better use `mkstemp'
/bin/sh: строка 1: 20776 Ошибка сегментирования                   (стек памяти сброшен на диск) CC='gcc -pthread' LDSHARED='gcc -pthread -shared ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py -q build
make: *** [Makefile:426: sharedmods] Ошибка 139


  STDERR:


Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 978, in <module>
    main()
  File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 975, in main
    ToolchainCL()
  File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 512, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 149, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/deax/PycharmProjects/kivy-app/.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 "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/build.py", line 573, in build_recipes
    recipe.build_arch(arch)
  File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/recipes/hostpython2/__init__.py", line 45, in build_arch
    shprint(sh.make, '-j5')
  File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/logger.py", line 175, in shprint
    for line in output:
  File "/usr/lib/python3.7/site-packages/sh.py", line 720, in next
    self.wait()
  File "/usr/lib/python3.7/site-packages/sh.py", line 651, in wait
    self.handle_command_exit_code(exit_code)
  File "/usr/lib/python3.7/site-packages/sh.py", line 672, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_2: 

  RAN: /usr/bin/make -j5

  STDOUT:
gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -o Modules/config.o Modules/config.c
gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -DPYTHONPATH='":plat-linux4:lib-tk:lib-old"' \
	-DPREFIX='"/usr/local"' \
	-DEXEC_PREFIX='"/usr/local"' \
	-DVERSION='"2.7"' \
	-DVPATH='""' \
	-o Modules/getpath.o ./Modules/getpath.c
In file included from Include/Python.h:126,
                 from Modules/config.c:19:
Include/modsupport.h:27:1: предупреждение: «PyArg_ParseTuple» некорректный вид функции форматирования [-Wformat=]
 PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
 ^~~~~~~~~~
In file included from Include/Python.h:126,
                 from ./Modules/getpath.c:3:
Include/modsupport.h:27:1: предупреждение: «PyArg_ParseTuple» некорректный вид функции форматирования [-Wformat=]
 PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
 ^~~~~~~~~~
./Modules/getpath.c: В функции «calculate_path»:
./Modules/getpath.c:497:17: предупреждение: «strncpy» output may be truncated copying 4096 bytes from a string of length 4096 [-Wstringop-truncation]
                 strncpy(argv0_path, tmpbuffer, MAXPATHLEN);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE \
      -DSVNVERSION="\"`LC_ALL=C echo Unversioned directory`\"" \
      -DHGVERSION="\"`LC_ALL=C `\"" \
      -DHGTAG="\"`LC_ALL=C `\"" \
      -DHGBRANCH="\"`LC_ALL=C `\"" \
      -o Modules/getbuildinfo.o ./Modules/getbuildinfo.c
In file included from Include/Python.h:126,
                 from ./Modules/getbuildinfo.c:1:
Include/modsupport.h:27:1: предупреждение: «PyArg_ParseTuple» некорректный вид функции форматирования [-Wformat=]
 PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
 ^~~~~~~~~~
rm -f libpython2.7.a
ar rc libpython2.7.a Modules/getbuildinfo.o
ar rc libpython2.7.a Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o Parser/parsetok.o Parser/bitset.o Parser/metagrammar.o Parser/firstsets.o Parser/grammar.o Parser/pgen.o Parser/myreadline.o Parser/tokenizer.o
ar rc libpython2.7.a Objects/abstract.o Objects/boolobject.o Objects/bufferobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/cobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/intobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/object.o Objects/obmalloc.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/stringobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/weakrefobject.o Objects/unicodeobject.o Objects/unicodectype.o
ar rc libpython2.7.a Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/bltinmodule.o Python/ceval.o Python/compile.o Python/codecs.o Python/errors.o Python/frozen.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/import.o Python/importdl.o Python/marshal.o Python/modsupport.o Python/mystrtoul.o Python/mysnprintf.o Python/peephole.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/dtoa.o Python/formatter_unicode.o Python/formatter_string.o Python/dynload_shlib.o   Python/thread.o
ar rc libpython2.7.a Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.o 
ar rc libpython2.7.a Modules/threadmodule.o  Modules/signalmodule.o  Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/zipimport.o  Modules/symtablemodule.o  Modules/arraymodule.o  Modules/cmathmodule.o  Modules/mathmodule.o  Modules/_struct.o  Modules/timemodule.o  Modules/operator.o  Modules/_weakref.o  Modules/_randommodule.o  Modules/_collectionsmodule.o  Modules/itertoolsmodule.o  Modules/stropmodule.o  Modules/_functoolsmodule.o  Modules/_elementtree.o  Modules/datetimemodule.o  Modules/_bisectmodule.o  Modules/fcntlmodule.o  Modules/selectmodule.o  Modules/socketmodule.o  Modules/md5module.o Modules/md5.o  Modules/shamodule.o  Modules/sha256module.o  Modules/sha512module.o  Modules/binascii.o  Modules/parsermodule.o  Modules/cStringIO.o  Modules/cPickle.o  Modules/zlibmodule.o  Modules/xmlparse.o Modules/xmlrole.o Modules/xmltok.o Modules/pyexpat.o  Modules/xxsubtype.o
ranlib libpython2.7.a
gcc -pthread  -Xlinker -export-dynamic -o python \
		Modules/python.o \
		libpython2.7.a -lpthread -ldl  -lutil -L/usr/local/lib -lz    -lm  
/usr/bin/ld: libpython2.7.a(posixmodule.o): in function `posix_tmpnam':
/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/./Modules/posixmodule.c:7370: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
/usr/bin/ld: libpython2.7.a(posixmodule.o): in function `posix_tempnam':
/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/./Modules/posixmodule.c:7317: warning: the use of `tempnam' is dangerous, better use `mkstemp'
/bin/sh: строка 1: 20776 Segmentation Error                   (memory stack flushed to disk) CC='gcc -pthread' LDSHARED='gcc -pthread -shared ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py -q build
make: *** [Makefile:426: sharedmods] error 139


  STDERR:

# 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="/home/deax/PycharmProjects/kivy-app/.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

TheDeaX-Lab avatar Dec 28 '18 18:12 TheDeaX-Lab

Change 'log_level=1' to 'log_level=2' in buildozer.spec

GuruDattaAkula

On Sat, Dec 29, 2018, 12:04 AM TerryChan2003 <[email protected] wrote:

i have segment error

[INFO]: -> running make -j5

Exception in thread background thread for pid 20746:

Traceback (most recent call last):

File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner

self.run()

File "/usr/lib/python3.7/threading.py", line 865, in run

self._target(*self._args, **self._kwargs)

File "/usr/lib/python3.7/site-packages/sh.py", line 2170, in background_thread

handle_exit_code(exit_code)

File "/usr/lib/python3.7/site-packages/sh.py", line 1929, in fn

return self.command.handle_command_exit_code(exit_code)

File "/usr/lib/python3.7/site-packages/sh.py", line 672, in handle_command_exit_code

raise exc

sh.ErrorReturnCode_2:

RAN: /usr/bin/make -j5

STDOUT:

gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE -o Modules/config.o Modules/config.c

gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE -DPYTHONPATH='":plat-linux4:lib-tk:lib-old"' \

-DPREFIX='"/usr/local"' \

-DEXEC_PREFIX='"/usr/local"' \

-DVERSION='"2.7"' \

-DVPATH='""' \

-o Modules/getpath.o ./Modules/getpath.c

In file included from Include/Python.h:126,

             from Modules/config.c:19:

Include/modsupport.h:27:1: предупреждение: «PyArg_ParseTuple» некорректный вид функции форматирования [-Wformat=]

PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);

^~~~~~~~~~

In file included from Include/Python.h:126,

             from ./Modules/getpath.c:3:

Include/modsupport.h:27:1: предупреждение: «PyArg_ParseTuple» некорректный вид функции форматирования [-Wformat=]

PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);

^~~~~~~~~~

./Modules/getpath.c: В функции «calculate_path»:

./Modules/getpath.c:497:17: предупреждение: «strncpy» output may be truncated copying 4096 bytes from a string of length 4096 [-Wstringop-truncation]

             strncpy(argv0_path, tmpbuffer, MAXPATHLEN);

             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE \

  -DSVNVERSION="\"`LC_ALL=C echo Unversioned directory`\"" \

  -DHGVERSION="\"`LC_ALL=C `\"" \

  -DHGTAG="\"`LC_ALL=C `\"" \

  -DHGBRANCH="\"`LC_ALL=C `\"" \

  -o Modules/getbuildinfo.o ./Modules/getbuildinfo.c

In file included from Include/Python.h:126,

             from ./Modules/getbuildinfo.c:1:

Include/modsupport.h:27:1: предупреждение: «PyArg_ParseTuple» некорректный вид функции форматирования [-Wformat=]

PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);

^~~~~~~~~~

rm -f libpython2.7.a

ar rc libpython2.7.a Modules/getbuildinfo.o

ar rc libpython2.7.a Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o Parser/parsetok.o Parser/bitset.o Parser/metagrammar.o Parser/firstsets.o Parser/grammar.o Parser/pgen.o Parser/myreadline.o Parser/tokenizer.o

ar rc libpython2.7.a Objects/abstract.o Objects/boolobject.o Objects/bufferobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/cobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/intobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/object.o Objects/obmalloc.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/stringobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/weakrefobject.o Objects/unicodeobject.o Objects/unicodectype.o

ar rc libpython2.7.a Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/bltinmodule.o Python/ceval.o Python/compile.o Python/codecs.o Python/errors.o Python/frozen.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/import.o Python/importdl.o Python/marshal.o Python/modsupport.o Python/mystrtoul.o Python/mysnprintf.o Python/peephole.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/dtoa.o Python/formatter_unicode.o Python/formatter_string.o Python/dynload_shlib.o Python/thread.o

ar rc libpython2.7.a Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.o

ar rc libpython2.7.a Modules/threadmodule.o Modules/signalmodule.o Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_codecsmodule.o Modules/zipimport.o Modules/symtablemodule.o Modules/arraymodule.o Modules/cmathmodule.o Modules/mathmodule.o Modules/_struct.o Modules/timemodule.o Modules/operator.o Modules/_weakref.o Modules/_randommodule.o Modules/_collectionsmodule.o Modules/itertoolsmodule.o Modules/stropmodule.o Modules/_functoolsmodule.o Modules/_elementtree.o Modules/datetimemodule.o Modules/_bisectmodule.o Modules/fcntlmodule.o Modules/selectmodule.o Modules/socketmodule.o Modules/md5module.o Modules/md5.o Modules/shamodule.o Modules/sha256module.o Modules/sha512module.o Modules/binascii.o Modules/parsermodule.o Modules/cStringIO.o Modules/cPickle.o Modules/zlibmodule.o Modules/xmlparse.o Modules/xmlrole.o Modules/xmltok.o Modules/pyexpat.o Modules/xxsubtype.o

ranlib libpython2.7.a

gcc -pthread -Xlinker -export-dynamic -o python \

  Modules/python.o \

  libpython2.7.a -lpthread -ldl  -lutil -L/usr/local/lib -lz    -lm

/usr/bin/ld: libpython2.7.a(posixmodule.o): in function `posix_tmpnam':

/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/./Modules/posixmodule.c:7370: warning: the use of tmpnam_r' is dangerous, better use mkstemp'

/usr/bin/ld: libpython2.7.a(posixmodule.o): in function `posix_tempnam':

/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/./Modules/posixmodule.c:7317: warning: the use of tempnam' is dangerous, better use mkstemp'

/bin/sh: строка 1: 20776 Ошибка сегментирования (стек памяти сброшен на диск) CC='gcc -pthread' LDSHARED='gcc -pthread -shared ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py -q build

make: *** [Makefile:426: sharedmods] Ошибка 139

STDERR:

Traceback (most recent call last):

File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main

"__main__", mod_spec)

File "/usr/lib/python3.7/runpy.py", line 85, in _run_code

exec(code, run_globals)

File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 978, in

main()

File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 975, in main

ToolchainCL()

File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 512, in init

getattr(self, args.subparser_name.replace('-', '_'))(args)

File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 149, in wrapper_func

build_dist_from_args(ctx, dist, args)

File "/home/deax/PycharmProjects/kivy-app/.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 "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/build.py", line 573, in build_recipes

recipe.build_arch(arch)

File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/recipes/hostpython2/init.py", line 45, in build_arch

shprint(sh.make, '-j5')

File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/logger.py", line 175, in shprint

for line in output:

File "/usr/lib/python3.7/site-packages/sh.py", line 720, in next

self.wait()

File "/usr/lib/python3.7/site-packages/sh.py", line 651, in wait

self.handle_command_exit_code(exit_code)

File "/usr/lib/python3.7/site-packages/sh.py", line 672, in handle_command_exit_code

raise exc

sh.ErrorReturnCode_2:

RAN: /usr/bin/make -j5

STDOUT:

gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE -o Modules/config.o Modules/config.c

gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE -DPYTHONPATH='":plat-linux4:lib-tk:lib-old"' \

-DPREFIX='"/usr/local"' \

-DEXEC_PREFIX='"/usr/local"' \

-DVERSION='"2.7"' \

-DVPATH='""' \

-o Modules/getpath.o ./Modules/getpath.c

In file included from Include/Python.h:126,

             from Modules/config.c:19:

Include/modsupport.h:27:1: предупреждение: «PyArg_ParseTuple» некорректный вид функции форматирования [-Wformat=]

PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);

^~~~~~~~~~

In file included from Include/Python.h:126,

             from ./Modules/getpath.c:3:

Include/modsupport.h:27:1: предупреждение: «PyArg_ParseTuple» некорректный вид функции форматирования [-Wformat=]

PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);

^~~~~~~~~~

./Modules/getpath.c: В функции «calculate_path»:

./Modules/getpath.c:497:17: предупреждение: «strncpy» output may be truncated copying 4096 bytes from a string of length 4096 [-Wstringop-truncation]

             strncpy(argv0_path, tmpbuffer, MAXPATHLEN);

             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE \

  -DSVNVERSION="\"`LC_ALL=C echo Unversioned directory`\"" \

  -DHGVERSION="\"`LC_ALL=C `\"" \

  -DHGTAG="\"`LC_ALL=C `\"" \

  -DHGBRANCH="\"`LC_ALL=C `\"" \

  -o Modules/getbuildinfo.o ./Modules/getbuildinfo.c

In file included from Include/Python.h:126,

             from ./Modules/getbuildinfo.c:1:

Include/modsupport.h:27:1: предупреждение: «PyArg_ParseTuple» некорректный вид функции форматирования [-Wformat=]

PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);

^~~~~~~~~~

rm -f libpython2.7.a

ar rc libpython2.7.a Modules/getbuildinfo.o

ar rc libpython2.7.a Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o Parser/parsetok.o Parser/bitset.o Parser/metagrammar.o Parser/firstsets.o Parser/grammar.o Parser/pgen.o Parser/myreadline.o Parser/tokenizer.o

ar rc libpython2.7.a Objects/abstract.o Objects/boolobject.o Objects/bufferobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/cobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/intobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/object.o Objects/obmalloc.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/stringobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/weakrefobject.o Objects/unicodeobject.o Objects/unicodectype.o

ar rc libpython2.7.a Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/bltinmodule.o Python/ceval.o Python/compile.o Python/codecs.o Python/errors.o Python/frozen.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/import.o Python/importdl.o Python/marshal.o Python/modsupport.o Python/mystrtoul.o Python/mysnprintf.o Python/peephole.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/dtoa.o Python/formatter_unicode.o Python/formatter_string.o Python/dynload_shlib.o Python/thread.o

ar rc libpython2.7.a Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.o

ar rc libpython2.7.a Modules/threadmodule.o Modules/signalmodule.o Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_codecsmodule.o Modules/zipimport.o Modules/symtablemodule.o Modules/arraymodule.o Modules/cmathmodule.o Modules/mathmodule.o Modules/_struct.o Modules/timemodule.o Modules/operator.o Modules/_weakref.o Modules/_randommodule.o Modules/_collectionsmodule.o Modules/itertoolsmodule.o Modules/stropmodule.o Modules/_functoolsmodule.o Modules/_elementtree.o Modules/datetimemodule.o Modules/_bisectmodule.o Modules/fcntlmodule.o Modules/selectmodule.o Modules/socketmodule.o Modules/md5module.o Modules/md5.o Modules/shamodule.o Modules/sha256module.o Modules/sha512module.o Modules/binascii.o Modules/parsermodule.o Modules/cStringIO.o Modules/cPickle.o Modules/zlibmodule.o Modules/xmlparse.o Modules/xmlrole.o Modules/xmltok.o Modules/pyexpat.o Modules/xxsubtype.o

ranlib libpython2.7.a

gcc -pthread -Xlinker -export-dynamic -o python \

  Modules/python.o \

  libpython2.7.a -lpthread -ldl  -lutil -L/usr/local/lib -lz    -lm

/usr/bin/ld: libpython2.7.a(posixmodule.o): in function `posix_tmpnam':

/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/./Modules/posixmodule.c:7370: warning: the use of tmpnam_r' is dangerous, better use mkstemp'

/usr/bin/ld: libpython2.7.a(posixmodule.o): in function `posix_tempnam':

/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/./Modules/posixmodule.c:7317: warning: the use of tempnam' is dangerous, better use mkstemp'

/bin/sh: строка 1: 20776 Ошибка сегментирования (стек памяти сброшен на диск) CC='gcc -pthread' LDSHARED='gcc -pthread -shared ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py -q build

make: *** [Makefile:426: sharedmods] Ошибка 139

STDERR:

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="/home/deax/PycharmProjects/kivy-app/.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

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kivy/buildozer/issues/760#issuecomment-450406361, or mute the thread https://github.com/notifications/unsubscribe-auth/AmrNLUMp5zPmzD0eHj_bzVoOW5hyvSMOks5u9mQ6gaJpZM4Y82Q- .

datta07 avatar Dec 28 '18 18:12 datta07

i have segment error

mistakes in a foreign language For English errors use: LANG=C command

homdx avatar Dec 28 '18 19:12 homdx

@homdx I fixed to English log_level=2

# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
/bin/sh: dpkg: command not found
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /usr/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-8-jdk/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-8-jdk/jre/bin/keytool
# Install platform
# Run "/usr/bin/python -m pip install -q --user 'appdirs' 'colorama>=0.3.3' 'jinja2' 'six'"
# Cwd None
# Apache ANT found at /home/deax/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/deax/.buildozer/android/platform/android-sdk-20
# Android NDK found at /home/deax/.buildozer/android/platform/android-ndk-r9c
# Check application requirements
# Check garden requirements
# Compile platform
# Run '/usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build"'
# Cwd /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py:73: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
[INFO]:    Will compile for the following archs: armeabi-v7a
[INFO]:    Found Android API target in $ANDROIDAPI
[INFO]:    Available Android APIs are (19)
[INFO]:    Requested API target 19 is available, continuing.
[INFO]:    Found NDK dir in $ANDROIDNDK
[INFO]:    Got NDK version from $ANDROIDNDKVER
[INFO]:    Using Google NDK r9c
[INFO]:    Found virtualenv at /usr/bin/virtualenv
[INFO]:    ccache is missing, the build will not be optimized in the future.
[INFO]:    Found the following toolchain versions: ['4.6', '4.8', 'clang3.3']
[INFO]:    Picking the latest gcc toolchain, here 4.8
[INFO]:    No existing dists meet the given requirements!
[INFO]:    No dist exists that meets your requirements, so one will be built.
[INFO]:    Found multiple valid dependency orders:
[INFO]:        ['hostpython2', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python2', 'sdl2', 'six', 'pyjnius', 'kivy']
[INFO]:        ['hostpython2', 'pygame_bootstrap_components', 'python2', 'sdl', 'six', 'pygame', 'pyjnius', 'kivy']
[INFO]:        ['hostpython3crystax', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python3crystax', 'sdl2', 'six', 'pyjnius', 'kivy']
[INFO]:    Using the first of these: ['hostpython2', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python2', 'sdl2', 'six', 'pyjnius', 'kivy']
[INFO]:    The selected bootstrap is sdl2_gradle
[INFO]:    # Creating dist with sdl2_gradle bootstrap
[INFO]:    Dist will have name myapp and recipes (kivy)
[INFO]:    Dist will also contain modules () installed from pip
[INFO]:    -> running cp -r /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/bootstraps/sdl2/buil...(and 114 more)
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/bootstrap_builds/sdl2_gradle-python2
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Recipe build order is ['hostpython2', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python2', 'sdl2', 'six', 'pyjnius', 'kivy']
[INFO]:    # Downloading recipes 
[INFO]:    Downloading hostpython2
[INFO]:    -> running mkdir -p /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/hostpython2
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/hostpython2
[INFO]:    -> running basename https://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
[INFO]:    hostpython2 download already cached, skipping                                                                                                                                     
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Downloading sdl2_image
[INFO]:    -> running mkdir -p /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/sdl2_image
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/sdl2_image
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.tar.gz
[INFO]:    sdl2_image download already cached, skipping                                                                                                                                      
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Downloading sdl2_mixer
[INFO]:    -> running mkdir -p /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/sdl2_mixer
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/sdl2_mixer
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz
[INFO]:    sdl2_mixer download already cached, skipping                                                                                                                                      
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Downloading sdl2_ttf
[INFO]:    -> running mkdir -p /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/sdl2_ttf
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/sdl2_ttf
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
[INFO]:    sdl2_ttf download already cached, skipping                                                                                                                                        
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Downloading python2
[INFO]:    -> running mkdir -p /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/python2
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/python2
[INFO]:    -> running basename https://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
[INFO]:    python2 download already cached, skipping                                                                                                                                         
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Downloading sdl2
[INFO]:    -> running mkdir -p /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/sdl2
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/sdl2
[INFO]:    -> running basename https://www.libsdl.org/release/SDL2-2.0.4.tar.gz
[INFO]:    sdl2 download already cached, skipping                                                                                                                                            
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Downloading six
[INFO]:    -> running mkdir -p /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/six
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/six
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz
[INFO]:    six download already cached, skipping                                                                                                                                             
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Downloading pyjnius
[INFO]:    -> running mkdir -p /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/pyjnius
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/pyjnius
[INFO]:    -> running basename https://github.com/kivy/pyjnius/archive/1.1.2.zip
[INFO]:    pyjnius download already cached, skipping                                                                                                                                         
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Downloading kivy
[INFO]:    -> running mkdir -p /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/kivy
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/packages/kivy
[INFO]:    -> running basename https://github.com/kivy/kivy/archive/1.10.0.zip
[INFO]:    kivy download already cached, skipping                                                                                                                                            
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    # Building all recipes for arch armeabi-v7a
[INFO]:    # Unpacking recipes
[INFO]:    Unpacking hostpython2 for armeabi-v7a
[INFO]:    -> running basename https://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop                                                 
[INFO]:    hostpython2 is already unpacked, skipping
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[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 /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/bootstrap_builds/sdl2_gradle-python2/jni                                         
[INFO]:    sdl2_image is already unpacked, skipping
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Unpacking sdl2_mixer for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/bootstrap_builds/sdl2_gradle-python2/jni                                         
[INFO]:    sdl2_mixer is already unpacked, skipping
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Unpacking sdl2_ttf for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/bootstrap_builds/sdl2_gradle-python2/jni                                         
[INFO]:    sdl2_ttf is already unpacked, skipping
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Unpacking python2 for armeabi-v7a
[INFO]:    -> running basename https://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/python2/armeabi-v7a                                                 
[INFO]:    python2 is already unpacked, skipping
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Unpacking sdl2 for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/release/SDL2-2.0.4.tar.gz
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/bootstrap_builds/sdl2_gradle-python2/jni                                         
[INFO]:    sdl2 is already unpacked, skipping
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Unpacking six for armeabi-v7a
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/six-python2/armeabi-v7a                                             
[INFO]:    six is already unpacked, skipping
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Unpacking pyjnius for armeabi-v7a
[INFO]:    -> running basename https://github.com/kivy/pyjnius/archive/1.1.2.zip
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/pyjnius-python2-sdl2/armeabi-v7a                                    
[INFO]:    pyjnius is already unpacked, skipping
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Unpacking kivy for armeabi-v7a
[INFO]:    -> running basename https://github.com/kivy/kivy/archive/1.10.0.zip
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/kivy-python2-sdl2/armeabi-v7a                                       
[INFO]:    kivy is already unpacked, skipping
[INFO]:    <- directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    # Prebuilding recipes
[INFO]:    Prebuilding hostpython2 for armeabi-v7a
[INFO]:    -> running cp /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/recipes/hostpython2/Set...(and 137 more)
[INFO]:    Prebuilding sdl2_image for armeabi-v7a
[INFO]:    sdl2_image has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sdl2_image[armeabi-v7a]
[INFO]:    sdl2_image already patched, skipping
[INFO]:    Prebuilding sdl2_mixer for armeabi-v7a
[INFO]:    sdl2_mixer has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sdl2_mixer[armeabi-v7a]
[INFO]:    sdl2_mixer already patched, skipping
[INFO]:    Prebuilding sdl2_ttf for armeabi-v7a
[INFO]:    sdl2_ttf has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding python2 for armeabi-v7a
[INFO]:    python2 has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for python2[armeabi-v7a]
[INFO]:    python2 already patched, skipping
[INFO]:    Prebuilding sdl2 for armeabi-v7a
[INFO]:    sdl2 has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sdl2[armeabi-v7a]
[INFO]:    sdl2 already patched, skipping
[INFO]:    Prebuilding six for armeabi-v7a
[INFO]:    six has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding pyjnius for armeabi-v7a
[INFO]:    pyjnius has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for pyjnius[armeabi-v7a]
[INFO]:    pyjnius already patched, skipping
[INFO]:    Prebuilding kivy for armeabi-v7a
[INFO]:    kivy has no prebuild_armeabi_v7a, skipping
[INFO]:    # Building recipes
[INFO]:    Building hostpython2 for armeabi-v7a
[INFO]:    -> directory context /home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2
[INFO]:    -> running configure
[INFO]:    -> running make -j5                                                                                                                                                               
Exception in thread background thread for pid 8273:                                                                                                                                          
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.7/site-packages/sh.py", line 2170, in background_thread
    handle_exit_code(exit_code)
  File "/usr/lib/python3.7/site-packages/sh.py", line 1929, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/usr/lib/python3.7/site-packages/sh.py", line 672, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_2: 

  RAN: /usr/bin/make -j5

  STDOUT:
gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -o Modules/config.o Modules/config.c
gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -DPYTHONPATH='":plat-linux4:lib-tk:lib-old"' \
	-DPREFIX='"/usr/local"' \
	-DEXEC_PREFIX='"/usr/local"' \
	-DVERSION='"2.7"' \
	-DVPATH='""' \
	-o Modules/getpath.o ./Modules/getpath.c
In file included from Include/Python.h:126,
                 from ./Modules/getpath.c:3:
Include/modsupport.h:27:1: warning: ‘PyArg_ParseTuple’ is an unrecognized format function type [-Wformat=]
 PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
 ^~~~~~~~~~
In file included from Include/Python.h:126,
                 from Modules/config.c:19:
Include/modsupport.h:27:1: warning: ‘PyArg_ParseTuple’ is an unrecognized format function type [-Wformat=]
 PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
 ^~~~~~~~~~
./Modules/getpath.c: In function ‘calculate_path’:
./Modules/getpath.c:497:17: warning: ‘strncpy’ output may be truncated copying 4096 bytes from a string of length 4096 [-Wstringop-truncation]
                 strncpy(argv0_path, tmpbuffer, MAXPATHLEN);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE \
      -DSVNVERSION="\"`LC_ALL=C echo Unversioned directory`\"" \
      -DHGVERSION="\"`LC_ALL=C `\"" \
      -DHGTAG="\"`LC_ALL=C `\"" \
      -DHGBRANCH="\"`LC_ALL=C `\"" \
      -o Modules/getbuildinfo.o ./Modules/getbuildinfo.c
In file included from Include/Python.h:126,
                 from ./Modules/getbuildinfo.c:1:
Include/modsupport.h:27:1: warning: ‘PyArg_ParseTuple’ is an unrecognized format function type [-Wformat=]
 PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
 ^~~~~~~~~~
rm -f libpython2.7.a
ar rc libpython2.7.a Modules/getbuildinfo.o
ar rc libpython2.7.a Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o Parser/parsetok.o Parser/bitset.o Parser/metagrammar.o Parser/firstsets.o Parser/grammar.o Parser/pgen.o Parser/myreadline.o Parser/tokenizer.o
ar rc libpython2.7.a Objects/abstract.o Objects/boolobject.o Objects/bufferobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/cobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/intobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/object.o Objects/obmalloc.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/stringobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/weakrefobject.o Objects/unicodeobject.o Objects/unicodectype.o
ar rc libpython2.7.a Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/bltinmodule.o Python/ceval.o Python/compile.o Python/codecs.o Python/errors.o Python/frozen.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/import.o Python/importdl.o Python/marshal.o Python/modsupport.o Python/mystrtoul.o Python/mysnprintf.o Python/peephole.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/dtoa.o Python/formatter_unicode.o Python/formatter_string.o Python/dynload_shlib.o   Python/thread.o
ar rc libpython2.7.a Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.o 
ar rc libpython2.7.a Modules/threadmodule.o  Modules/signalmodule.o  Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/zipimport.o  Modules/symtablemodule.o  Modules/arraymodule.o  Modules/cmathmodule.o  Modules/mathmodule.o  Modules/_struct.o  Modules/timemodule.o  Modules/operator.o  Modules/_weakref.o  Modules/_randommodule.o  Modules/_collectionsmodule.o  Modules/itertoolsmodule.o  Modules/stropmodule.o  Modules/_functoolsmodule.o  Modules/_elementtree.o  Modules/datetimemodule.o  Modules/_bisectmodule.o  Modules/fcntlmodule.o  Modules/selectmodule.o  Modules/socketmodule.o  Modules/md5module.o Modules/md5.o  Modules/shamodule.o  Modules/sha256module.o  Modules/sha512module.o  Modules/binascii.o  Modules/parsermodule.o  Modules/cStringIO.o  Modules/cPickle.o  Modules/zlibmodule.o  Modules/xmlparse.o Modules/xmlrole.o Modules/xmltok.o Modules/pyexpat.o  Modules/xxsubtype.o
ranlib libpython2.7.a
gcc -pthread  -Xlinker -export-dynamic -o python \
		Modules/python.o \
		libpython2.7.a -lpthread -ldl  -lutil -L/usr/local/lib -lz    -lm  
/usr/bin/ld: libpython2.7.a(posixmodule.o): in function `posix_tmpnam':
/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/./Modules/posixmodule.c:7370: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
/usr/bin/ld: libpython2.7.a(posixmodule.o): in function `posix_tempnam':
/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/./Modules/posixmodule.c:7317: warning: the use of `tempnam' is dangerous, better use `mkstemp'
/bin/sh: line 1:  8337 Segmentation fault      (core dumped) CC='gcc -pthread' LDSHARED='gcc -pthread -shared ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py -q build
make: *** [Makefile:426: sharedmods] Error 139


  STDERR:


Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 978, in <module>
    main()
  File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 975, in main
    ToolchainCL()
  File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 512, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/toolchain.py", line 149, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/deax/PycharmProjects/kivy-app/.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 "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/build.py", line 573, in build_recipes
    recipe.build_arch(arch)
  File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/recipes/hostpython2/__init__.py", line 45, in build_arch
    shprint(sh.make, '-j5')
  File "/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/python-for-android-new-toolchain/pythonforandroid/logger.py", line 175, in shprint
    for line in output:
  File "/usr/lib/python3.7/site-packages/sh.py", line 720, in next
    self.wait()
  File "/usr/lib/python3.7/site-packages/sh.py", line 651, in wait
    self.handle_command_exit_code(exit_code)
  File "/usr/lib/python3.7/site-packages/sh.py", line 672, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_2: 

  RAN: /usr/bin/make -j5

  STDOUT:
gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -o Modules/config.o Modules/config.c
gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -DPYTHONPATH='":plat-linux4:lib-tk:lib-old"' \
	-DPREFIX='"/usr/local"' \
	-DEXEC_PREFIX='"/usr/local"' \
	-DVERSION='"2.7"' \
	-DVPATH='""' \
	-o Modules/getpath.o ./Modules/getpath.c
In file included from Include/Python.h:126,
                 from ./Modules/getpath.c:3:
Include/modsupport.h:27:1: warning: ‘PyArg_ParseTuple’ is an unrecognized format function type [-Wformat=]
 PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
 ^~~~~~~~~~
In file included from Include/Python.h:126,
                 from Modules/config.c:19:
Include/modsupport.h:27:1: warning: ‘PyArg_ParseTuple’ is an unrecognized format function type [-Wformat=]
 PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
 ^~~~~~~~~~
./Modules/getpath.c: In function ‘calculate_path’:
./Modules/getpath.c:497:17: warning: ‘strncpy’ output may be truncated copying 4096 bytes from a string of length 4096 [-Wstringop-truncation]
                 strncpy(argv0_path, tmpbuffer, MAXPATHLEN);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE \
      -DSVNVERSION="\"`LC_ALL=C echo Unversioned directory`\"" \
      -DHGVERSION="\"`LC_ALL=C `\"" \
      -DHGTAG="\"`LC_ALL=C `\"" \
      -DHGBRANCH="\"`LC_ALL=C `\"" \
      -o Modules/getbuildinfo.o ./Modules/getbuildinfo.c
In file included from Include/Python.h:126,
                 from ./Modules/getbuildinfo.c:1:
Include/modsupport.h:27:1: warning: ‘PyArg_ParseTuple’ is an unrecognized format function type [-Wformat=]
 PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
 ^~~~~~~~~~
rm -f libpython2.7.a
ar rc libpython2.7.a Modules/getbuildinfo.o
ar rc libpython2.7.a Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o Parser/parsetok.o Parser/bitset.o Parser/metagrammar.o Parser/firstsets.o Parser/grammar.o Parser/pgen.o Parser/myreadline.o Parser/tokenizer.o
ar rc libpython2.7.a Objects/abstract.o Objects/boolobject.o Objects/bufferobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/cobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/intobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/object.o Objects/obmalloc.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/stringobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/weakrefobject.o Objects/unicodeobject.o Objects/unicodectype.o
ar rc libpython2.7.a Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/bltinmodule.o Python/ceval.o Python/compile.o Python/codecs.o Python/errors.o Python/frozen.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/import.o Python/importdl.o Python/marshal.o Python/modsupport.o Python/mystrtoul.o Python/mysnprintf.o Python/peephole.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/dtoa.o Python/formatter_unicode.o Python/formatter_string.o Python/dynload_shlib.o   Python/thread.o
ar rc libpython2.7.a Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.o 
ar rc libpython2.7.a Modules/threadmodule.o  Modules/signalmodule.o  Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/zipimport.o  Modules/symtablemodule.o  Modules/arraymodule.o  Modules/cmathmodule.o  Modules/mathmodule.o  Modules/_struct.o  Modules/timemodule.o  Modules/operator.o  Modules/_weakref.o  Modules/_randommodule.o  Modules/_collectionsmodule.o  Modules/itertoolsmodule.o  Modules/stropmodule.o  Modules/_functoolsmodule.o  Modules/_elementtree.o  Modules/datetimemodule.o  Modules/_bisectmodule.o  Modules/fcntlmodule.o  Modules/selectmodule.o  Modules/socketmodule.o  Modules/md5module.o Modules/md5.o  Modules/shamodule.o  Modules/sha256module.o  Modules/sha512module.o  Modules/binascii.o  Modules/parsermodule.o  Modules/cStringIO.o  Modules/cPickle.o  Modules/zlibmodule.o  Modules/xmlparse.o Modules/xmlrole.o Modules/xmltok.o Modules/pyexpat.o  Modules/xxsubtype.o
ranlib libpython2.7.a
gcc -pthread  -Xlinker -export-dynamic -o python \
		Modules/python.o \
		libpython2.7.a -lpthread -ldl  -lutil -L/usr/local/lib -lz    -lm  
/usr/bin/ld: libpython2.7.a(posixmodule.o): in function `posix_tmpnam':
/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/./Modules/posixmodule.c:7370: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
/usr/bin/ld: libpython2.7.a(posixmodule.o): in function `posix_tempnam':
/home/deax/PycharmProjects/kivy-app/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/./Modules/posixmodule.c:7317: warning: the use of `tempnam' is dangerous, better use `mkstemp'
/bin/sh: line 1:  8337 Segmentation fault      (core dumped) CC='gcc -pthread' LDSHARED='gcc -pthread -shared ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py -q build
make: *** [Makefile:426: sharedmods] Error 139


  STDERR:

# 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="/home/deax/PycharmProjects/kivy-app/.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

TheDeaX-Lab avatar Dec 29 '18 09:12 TheDeaX-Lab

I also had this error. If you want to use python3 without the crystax ndk you will need to use these exact specs https://github.com/kivy/kivy/wiki/Android-SDK-NDK-Information and probably use the p4a branch rather than buildozer. Otherwise you can just use python3crystax, which is fine as long as you don't require android api higher than 21 for your program to actually run you should be fine

fr3nzy avatar Dec 29 '18 11:12 fr3nzy

Looks like the NDK download URL has been a bit of a moving target.

two ways I was able to resolve this:

option 1) to get buildozer to perform the download for you by correcting the download URL: <PYTHON_INSTALL_DIR>/site_packages/buildozer/targets/android.py line 316

If anyone have difficulties to finding this: python -m site --user-site or python3 -m site --user-site

megapro17 avatar Jan 23 '19 19:01 megapro17

I'm still getting this error even though I've replaced the NDK url. Any other suggestions?

IbbyHussain avatar Apr 01 '20 16:04 IbbyHussain

Had the same issue. Turns out it was my proxy setting that caused trouble when downloading files, i.e. I removed http_proxy and https_proxy and then it worked. Hope, that helps.

nicolasholland avatar Jul 01 '20 08:07 nicolasholland

bro this file path that you named here is not in Ubuntu please if you can help me fix this thanks so much

techdude2000 avatar Dec 04 '20 20:12 techdude2000

Hello, i had same error and i try everything one by one.Finally i find cause of error: when i do p4a.branch = develop it give error but when i do #p4a.branch = develop it working.I found the cause but i need p4a.branch=develop so idk what i am have to do.

MrAaz44 avatar Apr 10 '22 16:04 MrAaz44

Can you please add a full log?

Hello, i had same error and i try everything one by one.Finally i find cause of error: when i do p4a.branch = develop it give error but when i do #p4a.branch = develop it working.I found the cause but i need p4a.branch=develop so idk what i am have to do.

misl6 avatar Apr 10 '22 17:04 misl6

Can you please add a full log?

Hello, i had same error and i try everything one by one.Finally i find cause of error: when i do p4a.branch = develop it give error but when i do #p4a.branch = develop it working.I found the cause but i need p4a.branch=develop so idk what i am have to do.

# Check configuration tokens
Buildozer is running as root!
This is not recommended, and may lead to problems later.
Are you sure you want to continue [y/n]? y
# Ensure build layout
# Check configuration tokens
# Read available permissions from api-versions.xml
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian 'dpkg' package management program version 1.19.0.5 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /usr/local/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-11-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-11-openjdk-amd64/bin/keytool
# Install platform
# Run 'git config --get remote.origin.url'
# Cwd /content/.buildozer/android/platform/python-for-android
https://github.com/kivy/python-for-android.git
# Run 'git branch -vv'
# Cwd /content/.buildozer/android/platform/python-for-android
* master 227a7658 [origin/master] Merge pull request #2561 from misl6/release-2022.03.13
# Detected old url/branch (https://github.com/kivy/python-for-android.git/master), deleting...
# Run 'git clone -b develop --single-branch https://github.com/kivy/python-for-android.git python-for-android'
# Cwd /content/.buildozer/android/platform
Cloning into 'python-for-android'...
# Run '/usr/bin/python3 -m pip install -q --user \'appdirs\' \'colorama>=0.3.3\' \'jinja2\' \'six\' \'enum34; python_version<"3.4"\' \'sh>=1.10; sys_platform!="nt"\' \'pep517<0.7.0\' \'toml\''
# Cwd None
# Apache ANT found at /root/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /root/.buildozer/android/platform/android-sdk
# Recommended android's NDK version by p4a is: 23b
# Android NDK is missing, downloading
# Downloading https://dl.google.com/android/repository/android-ndk-r23b-linux-x86_64.zip
Traceback (most recent call last):
  File "/usr/local/bin/buildozer", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/dist-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/usr/local/lib/python3.7/dist-packages/buildozer/__init__.py", line 1020, in run_command
    self.target.run_commands(args)
  File "/usr/local/lib/python3.7/dist-packages/buildozer/target.py", line 93, in run_commands
    func(args)
  File "/usr/local/lib/python3.7/dist-packages/buildozer/target.py", line 110, in cmd_release
    self.buildozer.prepare_for_build()
  File "/usr/local/lib/python3.7/dist-packages/buildozer/__init__.py", line 170, in prepare_for_build
    self.target.install_platform()
  File "/usr/local/lib/python3.7/dist-packages/buildozer/targets/android.py", line 702, in install_platform
    self._install_android_ndk()
  File "/usr/local/lib/python3.7/dist-packages/buildozer/targets/android.py", line 494, in _install_android_ndk
    cwd=self.buildozer.global_platform_dir)
  File "/usr/local/lib/python3.7/dist-packages/buildozer/__init__.py", line 654, in download
    urlretrieve(url, filename, report_hook)
  File "/usr/lib/python3.7/urllib/request.py", line 1850, in retrieve
    block = fp.read(bs)
  File "/usr/lib/python3.7/tempfile.py", line 620, in func_wrapper
    return func(*args, **kwargs)
ValueError: read of closed file

Here is the full log

MrAaz44 avatar Apr 11 '22 14:04 MrAaz44

Can you please add a full log?

Hello, i had same error and i try everything one by one.Finally i find cause of error: when i do p4a.branch = develop it give error but when i do #p4a.branch = develop it working.I found the cause but i need p4a.branch=develop so idk what i am have to do.

# Check configuration tokens
Buildozer is running as root!
This is not recommended, and may lead to problems later.
Are you sure you want to continue [y/n]? y
# Ensure build layout
# Check configuration tokens
# Read available permissions from api-versions.xml
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian 'dpkg' package management program version 1.19.0.5 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /usr/local/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-11-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-11-openjdk-amd64/bin/keytool
# Install platform
# Run 'git config --get remote.origin.url'
# Cwd /content/.buildozer/android/platform/python-for-android
https://github.com/kivy/python-for-android.git
# Run 'git branch -vv'
# Cwd /content/.buildozer/android/platform/python-for-android
* master 227a7658 [origin/master] Merge pull request #2561 from misl6/release-2022.03.13
# Detected old url/branch (https://github.com/kivy/python-for-android.git/master), deleting...
# Run 'git clone -b develop --single-branch https://github.com/kivy/python-for-android.git python-for-android'
# Cwd /content/.buildozer/android/platform
Cloning into 'python-for-android'...
# Run '/usr/bin/python3 -m pip install -q --user \'appdirs\' \'colorama>=0.3.3\' \'jinja2\' \'six\' \'enum34; python_version<"3.4"\' \'sh>=1.10; sys_platform!="nt"\' \'pep517<0.7.0\' \'toml\''
# Cwd None
# Apache ANT found at /root/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /root/.buildozer/android/platform/android-sdk
# Recommended android's NDK version by p4a is: 23b
# Android NDK is missing, downloading
# Downloading https://dl.google.com/android/repository/android-ndk-r23b-linux-x86_64.zip
Traceback (most recent call last):
  File "/usr/local/bin/buildozer", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/dist-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/usr/local/lib/python3.7/dist-packages/buildozer/__init__.py", line 1020, in run_command
    self.target.run_commands(args)
  File "/usr/local/lib/python3.7/dist-packages/buildozer/target.py", line 93, in run_commands
    func(args)
  File "/usr/local/lib/python3.7/dist-packages/buildozer/target.py", line 110, in cmd_release
    self.buildozer.prepare_for_build()
  File "/usr/local/lib/python3.7/dist-packages/buildozer/__init__.py", line 170, in prepare_for_build
    self.target.install_platform()
  File "/usr/local/lib/python3.7/dist-packages/buildozer/targets/android.py", line 702, in install_platform
    self._install_android_ndk()
  File "/usr/local/lib/python3.7/dist-packages/buildozer/targets/android.py", line 494, in _install_android_ndk
    cwd=self.buildozer.global_platform_dir)
  File "/usr/local/lib/python3.7/dist-packages/buildozer/__init__.py", line 654, in download
    urlretrieve(url, filename, report_hook)
  File "/usr/lib/python3.7/urllib/request.py", line 1850, in retrieve
    block = fp.read(bs)
  File "/usr/lib/python3.7/tempfile.py", line 620, in func_wrapper
    return func(*args, **kwargs)
ValueError: read of closed file

Here is the full log

Your issue is buildozer related, and could be fixed via this PR: https://github.com/kivy/buildozer/pull/1427

misl6 avatar Apr 11 '22 19:04 misl6

I had the same problem

(venv) (base) style@style-surface-pro:/media/style/softeware6/Kivy-app/GUI_Example$ buildozer android debug deploy run
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Read available permissions from api-versions.xml
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian dpkg 软件包管理程序 1.19.7 (amd64) 版。
本软件是自由软件;要获知复制该软件的条件,请参阅 GNU 公共许可证
第二版或其更新的版本。本软件【不】提供任何担保。
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /home/style/anaconda3/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-11-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool
# Install platform
# Run 'git config --get remote.origin.url'
# Cwd /media/style/softeware6/Kivy-app/GUI_Example/.buildozer/android/platform/python-for-android
https://github.com/kivy/python-for-android.git
# Run 'git branch -vv'
# Cwd /media/style/softeware6/Kivy-app/GUI_Example/.buildozer/android/platform/python-for-android
* master 17ec678c [origin/master] Merge pull request #2638 from misl6/release-2022.07.20
# Run '/usr/bin/python3 -m pip install -q  \'appdirs\' \'colorama>=0.3.3\' \'jinja2\' \'six\' \'enum34; python_version<"3.4"\' \'sh>=1.10; sys_platform!="nt"\' \'pep517<0.7.0\' \'toml\''
# Cwd None
# Apache ANT found at /home/style/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/style/.buildozer/android/platform/android-sdk
# Recommended android's NDK version by p4a is: 23b
# Android NDK is missing, downloading
# Downloading https://dl.google.com/android/repository/android-ndk-r23b-linux-x86_64.zip
Traceback (most recent call last):
  File "/usr/local/bin/buildozer", line 33, in <module>
    sys.exit(load_entry_point('buildozer==1.2.0.dev0', 'console_scripts', 'buildozer')())
  File "/usr/local/lib/python3.8/dist-packages/buildozer-1.2.0.dev0-py3.8.egg/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/usr/local/lib/python3.8/dist-packages/buildozer-1.2.0.dev0-py3.8.egg/buildozer/__init__.py", line 1020, in run_command
    self.target.run_commands(args)
  File "/usr/local/lib/python3.8/dist-packages/buildozer-1.2.0.dev0-py3.8.egg/buildozer/target.py", line 92, in run_commands
    func(args)
  File "/usr/local/lib/python3.8/dist-packages/buildozer-1.2.0.dev0-py3.8.egg/buildozer/target.py", line 102, in cmd_debug
    self.buildozer.prepare_for_build()
  File "/usr/local/lib/python3.8/dist-packages/buildozer-1.2.0.dev0-py3.8.egg/buildozer/__init__.py", line 170, in prepare_for_build
    self.target.install_platform()
  File "/usr/local/lib/python3.8/dist-packages/buildozer-1.2.0.dev0-py3.8.egg/buildozer/targets/android.py", line 670, in install_platform
    self._install_android_ndk()
  File "/usr/local/lib/python3.8/dist-packages/buildozer-1.2.0.dev0-py3.8.egg/buildozer/targets/android.py", line 460, in _install_android_ndk
    self.buildozer.download(url,
  File "/usr/local/lib/python3.8/dist-packages/buildozer-1.2.0.dev0-py3.8.egg/buildozer/__init__.py", line 654, in download
    urlretrieve(url, filename, report_hook)
  File "/usr/lib/python3.8/urllib/request.py", line 1855, in retrieve
    block = fp.read(bs)
  File "/usr/lib/python3.8/tempfile.py", line 612, in func_wrapper
    return func(*args, **kwargs)
ValueError: read of closed file

Manually download using the URL Downloading https://dl.google.com/android/repository/android-ndk-r23b-linux-x86_64.zip error 404 ,There's nothing wrong with my network。 .spec

[app]

# (str) Title of your application
title = wificar

# (str) Package name
package.name = wificar_demo

# (str) Package domain (needed for android/ios packaging)
package.domain = org.test

# (str) Source code where the main.py live
source.dir = .

# (list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas,ttf

# (list) List of inclusions using pattern matching
#source.include_patterns = assets/*,images/*.png

# (list) Source files to exclude (let empty to not exclude anything)
#source.exclude_exts = spec

# (list) List of directory to exclude (let empty to not exclude anything)
#source.exclude_dirs = tests, bin, venv

# (list) List of exclusions using pattern matching
#source.exclude_patterns = license,images/*/*.jpg

# (str) Application versioning (method 1)
version = 0.1

# (str) Application versioning (method 2)
# version.regex = __version__ = ['"](.*)['"]
# version.filename = %(source.dir)s/main.py

# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = python3,kivy,requests,urllib3,chardet,idna

# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
# requirements.source.kivy = ../../kivy

# (str) Presplash of the application
#presplash.filename = %(source.dir)s/data/presplash.png

# (str) Icon of the application
#icon.filename = %(source.dir)s/data/icon.png

# (str) Supported orientation (one of landscape, sensorLandscape, portrait or all)
orientation = portrait

# (list) List of service to declare
#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY

#
# OSX Specific
#

#
# author = © Copyright Info

# change the major version of python used by the app
osx.python_version = 3

# Kivy version to use
osx.kivy_version = 1.9.1

#
# Android specific
#

# (bool) Indicate if the application should be fullscreen or not
fullscreen = 0

# (string) Presplash background color (for android toolchain)
# Supported formats are: #RRGGBB #AARRGGBB or one of the following names:
# red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray,
# darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy,
# olive, purple, silver, teal.
#android.presplash_color = #FFFFFF

# (string) Presplash animation using Lottie format.
# see https://lottiefiles.com/ for examples and https://airbnb.design/lottie/
# for general documentation.
# Lottie files can be created using various tools, like Adobe After Effect or Synfig.
#android.presplash_lottie = "path/to/lottie/file.json"

# (str) Adaptive icon of the application (used if Android API level is 26+ at runtime)
#icon.adaptive_foreground.filename = %(source.dir)s/data/icon_fg.png
#icon.adaptive_background.filename = %(source.dir)s/data/icon_bg.png

# (list) Permissions
android.permissions = INTERNET

# (list) features (adds uses-feature -tags to manifest)
#android.features = android.hardware.usb.host

# (int) Target Android API, should be as high as possible.
#android.api = 27


# (int) Minimum API your APK will support.
#android.minapi = 21

# (int) Android SDK version to use
#android.sdk = 20

# (str) Android NDK version to use
#android.ndk = 19b

# (int) Android NDK API to use. This is the minimum API your app will support, it should usually match android.minapi.
#android.ndk_api = 21

# (bool) Use --private data storage (True) or --dir public storage (False)
#android.private_storage = True

# (str) Android NDK directory (if empty, it will be automatically downloaded.)
#android.ndk_path =

# (str) Android SDK directory (if empty, it will be automatically downloaded.)
#android.sdk_path =

# (str) ANT directory (if empty, it will be automatically downloaded.)
#android.ant_path =

# (bool) If True, then skip trying to update the Android sdk
# This can be useful to avoid excess Internet downloads or save time
# when an update is due and you just want to test/build your package
# android.skip_update = False
android.skip_update = True

# (bool) If True, then automatically accept SDK license
# agreements. This is intended for automation only. If set to False,
# the default, you will be shown the license when first running
# buildozer.
# android.accept_sdk_license = False

# (str) Android entry point, default is ok for Kivy-based app
#android.entrypoint = org.renpy.android.PythonActivity

# (str) Android app theme, default is ok for Kivy-based app
# android.apptheme = "@android:style/Theme.NoTitleBar"

# (list) Pattern to whitelist for the whole project
#android.whitelist =

# (str) Path to a custom whitelist file
#android.whitelist_src =

# (str) Path to a custom blacklist file
#android.blacklist_src =

# (list) List of Java .jar files to add to the libs so that pyjnius can access
# their classes. Don't add jars that you do not need, since extra jars can slow
# down the build process. Allows wildcards matching, for example:
# OUYA-ODK/libs/*.jar
#android.add_jars = foo.jar,bar.jar,path/to/more/*.jar

# (list) List of Java files to add to the android project (can be java or a
# directory containing the files)
#android.add_src =

# (list) Android AAR archives to add
#android.add_aars =

# (list) Gradle dependencies to add
#android.gradle_dependencies =

# (bool) Enable AndroidX support. Enable when 'android.gradle_dependencies'
# contains an 'androidx' package, or any package from Kotlin source.
# android.enable_androidx requires android.api >= 28
#android.enable_androidx = False

# (list) add java compile options
# this can for example be necessary when importing certain java libraries using the 'android.gradle_dependencies' option
# see https://developer.android.com/studio/write/java8-support for further information
# android.add_compile_options = "sourceCompatibility = 1.8", "targetCompatibility = 1.8"

# (list) Gradle repositories to add {can be necessary for some android.gradle_dependencies}
# please enclose in double quotes 
# e.g. android.gradle_repositories = "maven { url 'https://kotlin.bintray.com/ktor' }"
#android.add_gradle_repositories =

# (list) packaging options to add 
# see https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html
# can be necessary to solve conflicts in gradle_dependencies
# please enclose in double quotes 
# e.g. android.add_packaging_options = "exclude 'META-INF/common.kotlin_module'", "exclude 'META-INF/*.kotlin_module'"
#android.add_packaging_options =

# (list) Java classes to add as activities to the manifest.
#android.add_activities = com.example.ExampleActivity

# (str) OUYA Console category. Should be one of GAME or APP
# If you leave this blank, OUYA support will not be enabled
#android.ouya.category = GAME

# (str) Filename of OUYA Console icon. It must be a 732x412 png image.
#android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png

# (str) XML file to include as an intent filters in <activity> tag
#android.manifest.intent_filters =

# (str) launchMode to set for the main activity
#android.manifest.launch_mode = standard

# (list) Android additional libraries to copy into libs/armeabi
#android.add_libs_armeabi = libs/android/*.so
#android.add_libs_armeabi_v7a = libs/android-v7/*.so
#android.add_libs_arm64_v8a = libs/android-v8/*.so
#android.add_libs_x86 = libs/android-x86/*.so
#android.add_libs_mips = libs/android-mips/*.so

# (bool) Indicate whether the screen should stay on
# Don't forget to add the WAKE_LOCK permission if you set this to True
#android.wakelock = False

# (list) Android application meta-data to set (key=value format)
#android.meta_data =

# (list) Android library project to add (will be added in the
# project.properties automatically.)
#android.library_references =

# (list) Android shared libraries which will be added to AndroidManifest.xml using <uses-library> tag
#android.uses_library =

# (str) Android logcat filters to use
#android.logcat_filters = *:S python:D

# (bool) Android logcat only display log for activity's pid
#android.logcat_pid_only = False

# (str) Android additional adb arguments
#android.adb_args = -H host.docker.internal

# (bool) Copy library instead of making a libpymodules.so
#android.copy_libs = 1

# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86, x86_64
android.arch = armeabi-v7a

# (int) overrides automatic versionCode computation (used in build.gradle)
# this is not the same as app version and should only be edited if you know what you're doing
# android.numeric_version = 1

# (bool) enables Android auto backup feature (Android API >=23)
android.allow_backup = True

# (str) XML file for custom backup rules (see official auto backup documentation)
# android.backup_rules =

# (str) If you need to insert variables into your AndroidManifest.xml file,
# you can do so with the manifestPlaceholders property.
# This property takes a map of key-value pairs. (via a string)
# Usage example : android.manifest_placeholders = [myCustomUrl:\"org.kivy.customurl\"]
# android.manifest_placeholders = [:]

# (bool) disables the compilation of py to pyc/pyo files when packaging
# android.no-compile-pyo = True

#
# Python for android (p4a) specific
#

# (str) python-for-android URL to use for checkout
#p4a.url =

# (str) python-for-android fork to use in case if p4a.url is not specified, defaults to upstream (kivy)
#p4a.fork = kivy

# (str) python-for-android branch to use, defaults to master
p4a.branch = master 

# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
#p4a.source_dir =

# (str) The directory in which python-for-android should look for your own build recipes (if any)
#p4a.local_recipes =

# (str) Filename to the hook for p4a
#p4a.hook =

# (str) Bootstrap to use for android builds
# p4a.bootstrap = sdl2

# (int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask)
#p4a.port =

# Control passing the --use-setup-py vs --ignore-setup-py to p4a
# "in the future" --use-setup-py is going to be the default behaviour in p4a, right now it is not
# Setting this to false will pass --ignore-setup-py, true will pass --use-setup-py
# NOTE: this is general setuptools integration, having pyproject.toml is enough, no need to generate
# setup.py if you're using Poetry, but you need to add "toml" to source.include_exts.
#p4a.setup_py = false


#
# iOS specific
#

# (str) Path to a custom kivy-ios folder
#ios.kivy_ios_dir = ../kivy-ios
# Alternately, specify the URL and branch of a git checkout:
ios.kivy_ios_url = https://github.com/kivy/kivy-ios
ios.kivy_ios_branch = master

# Another platform dependency: ios-deploy
# Uncomment to use a custom checkout
#ios.ios_deploy_dir = ../ios_deploy
# Or specify URL and branch
ios.ios_deploy_url = https://github.com/phonegap/ios-deploy
ios.ios_deploy_branch = 1.10.0

# (bool) Whether or not to sign the code
ios.codesign.allowed = false

# (str) Name of the certificate to use for signing the debug version
# Get a list of available identities: buildozer ios list_identities
#ios.codesign.debug = "iPhone Developer: <lastname> <firstname> (<hexstring>)"

# (str) The development team to use for signing the debug version
#ios.codesign.development_team.debug = <hexstring>

# (str) Name of the certificate to use for signing the release version
#ios.codesign.release = %(ios.codesign.debug)s

# (str) The development team to use for signing the release version
#ios.codesign.development_team.release = <hexstring>

# (str) URL pointing to .ipa file to be installed
# This option should be defined along with `display_image_url` and `full_size_image_url` options.
#ios.manifest.app_url =

# (str) URL pointing to an icon (57x57px) to be displayed during download
# This option should be defined along with `app_url` and `full_size_image_url` options.
#ios.manifest.display_image_url =

# (str) URL pointing to a large icon (512x512px) to be used by iTunes
# This option should be defined along with `app_url` and `display_image_url` options.
#ios.manifest.full_size_image_url =


[buildozer]

# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2

# (int) Display warning if buildozer is run as root (0 = False, 1 = True)
warn_on_root = 1

# (str) Path to build artifact storage, absolute or relative to spec file
# build_dir = ./.buildozer

# (str) Path to build output (i.e. .apk, .ipa) storage
# bin_dir = ./bin

#    -----------------------------------------------------------------------------
#    List as sections
#
#    You can define all the "list" as [section:key].
#    Each line will be considered as a option to the list.
#    Let's take [app] / source.exclude_patterns.
#    Instead of doing:
#
#[app]
#source.exclude_patterns = license,data/audio/*.wav,data/images/original/*
#
#    This can be translated into:
#
#[app:source.exclude_patterns]
#license
#data/audio/*.wav
#data/images/original/*
#


#    -----------------------------------------------------------------------------
#    Profiles
#
#    You can extend section / key with a profile
#    For example, you want to deploy a demo version of your application without
#    HD content. You could first change the title to add "(demo)" in the name
#    and extend the excluded directories to remove the HD content.
#
#[app@demo]
#title = My Application (demo)
#
#[app:source.exclude_patterns@demo]
#images/hd/*
#
#    Then, invoke the command line with the "demo" profile:
#
#buildozer --profile demo android debug

zhenhuashao avatar Sep 19 '22 09:09 zhenhuashao

Hi, @zhenhuashao! Looks like your buildozer is outdated, NDK 23b requires a new buildozer version.

I'm closing this issue as the original one has been already fixed a long time ago.

misl6 avatar Sep 19 '22 19:09 misl6

Looks like the NDK download URL has been a bit of a moving target.

two ways I was able to resolve this:

option 1) to get buildozer to perform the download for you by correcting the download URL: <PYTHON_INSTALL_DIR>/site_packages/buildozer/targets/android.py line 316 change the url from /repository/ to /ndk/ then rerun buildozer as normal and it detects that the NDK is missing and downloads it from the correct URL.

option 2) do the download by hand per codingsett's comment, but make sure you have the version that buildozer expects. In my case it wants r9c. So download http://dl.google.com/android/ndk/android-ndk-r9c-linux-x86_64.tar.bz2, and unzip it into the expected location, in this case ~/.buildozer/android/platform then run buildozer again as normal.

Hi

How do you find out which version of NDK file your buildozer expects?

RichardKnipe avatar Dec 07 '22 19:12 RichardKnipe