#9280·kivy

Please tag a new release

Author: C0rn3jCreated Mar 15, 2026Updated Sep 4, 2026

Software Versions

  • Python: 3.14
  • OS: Arch Linux
  • Kivy: 2.3.1
  • Kivy installation method: buildozer -v android debug

Describe the bug Kivy won't build due to an undefined long error - this seems fixed in master long time ago, but a new release hasn't been made, could one be please tagged?

Expected behavior It builds.

Code and Logs and screenshots

python

[INFO]:    kivy first build failed (as expected)
[INFO]:    Running cython where appropriate
[INFO]:    Cythonize kivy/_event.pyx
[DEBUG]:   -> running python3 -cimport sys; from Cython.Compiler.Main import setuptools_main; sys.exit(setuptools_main()); ./kivy/_event.pyx
[INFO]:    Cythonize kivy/properties.pyx
[DEBUG]:   -> running python3 -cimport sys; from Cython.Compiler.Main import setuptools_main; sys.exit(setuptools_main()); ./kivy/properties.pyx
[INFO]:    Cythonize kivy/weakproxy.pyx
[DEBUG]:   -> running python3 -cimport sys; from Cython.Compiler.Main import setuptools_main; sys.exit(setuptools_main()); ./kivy/weakproxy.pyx
[DEBUG]:   
[DEBUG]:        Error compiling Cython file:
[DEBUG]:        ------------------------------------------------------------
[DEBUG]:        ...
[DEBUG]:   
[DEBUG]:            def __int__(self):
[DEBUG]:                return int(self.__ref__())
[DEBUG]:   
[DEBUG]:            def __long__(self):
[DEBUG]:                return long(self.__ref__())
[DEBUG]:                       ^
[DEBUG]:        ------------------------------------------------------------
[DEBUG]:        kivy/weakproxy.pyx:257:15: undeclared name not builtin: long
Exception in thread background thread for pid 570157:
Traceback (most recent call last):
  File "/usr/lib/python3.14/threading.py", line 1082, in _bootstrap_inner
    self._context.run(self.run)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/usr/lib/python3.14/threading.py", line 1024, in run
    self._target(*self._args, **self._kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.14/site-packages/sh.py", line 1642, in wrap
    fn(*rgs, **kwargs)
    ~~^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.14/site-packages/sh.py", line 2647, in background_thread
    handle_exit_code(exit_code)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/lib/python3.14/site-packages/sh.py", line 2338, in fn
    return self.command.handle_command_exit_code(exit_code)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/lib/python3.14/site-packages/sh.py", line 823, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /usr/bin/python3 '-cimport sys; from Cython.Compiler.Main import setuptools_main; sys.exit(setuptools_main());' ./kivy/weakproxy.pyx

  STDOUT:

Error compiling Cython file:
------------------------------------------------------------
...

    def __int__(self):
        return int(self.__ref__())

    def __long__(self):
        return long(self.__ref__())
               ^
------------------------------------------------------------
kivy/weakproxy.pyx:257:15: undeclared name not builtin: long


  STDERR:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/ user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1256, in <module>
    main()
    ~~~~^^
  File "/home/ user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
    ~~~~~~~~~~~^^
  File "/home/ user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 685, in __init__
    getattr(self, command)(args)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/ user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 104, in wrapper_func
    build_dist_from_args(ctx, dist, args)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/ user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 163, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx,
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  getattr(args, "private", None),
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
                  ),
                  ^^
                 )
                 ^
  File "/home/ user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 504, in build_recipes
    recipe.build_arch(arch)
    ~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/ user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1030, in build_arch
    self.build_cython_components(arch)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/ user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1055, in build_cython_components
    self.cythonize_build(env=env)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/home/ user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/kivy/__init__.py", line 38, in cythonize_build
    super().cythonize_build(env, build_dir=build_dir)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1103, in cythonize_build
    self.cythonize_file(env, build_dir, join(root, filename))
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/kivy/__init__.py", line 59, in cythonize_file
    super().cythonize_file(env, build_dir, filename)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1092, in cythonize_file
    shprint(python_command, "-c"
    ~~~~~~~^^^^^^^^^^^^^^^^^^^^^
            "import sys; from Cython.Compiler.Main import setuptools_main; sys.exit(setuptools_main());",
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            filename, *self.cython_args, _env=cyenv)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ user/Projects/Tauon/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 167, in shprint
    for line in output:
                ^^^^^^
  File "/usr/lib/python3.14/site-packages/sh.py", line 879, in __next__
    self.wait()
    ~~~~~~~~~^^
  File "/usr/lib/python3.14/site-packages/sh.py", line 796, in wait
    self.handle_command_exit_code(exit_code)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/lib/python3.14/site-packages/sh.py", line 823, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /usr/bin/python3 '-cimport sys; from Cython.Compiler.Main import setuptools_main; sys.exit(setuptools_main());' ./kivy/weakproxy.pyx

  STDOUT:

Error compiling Cython file:
------------------------------------------------------------
...

    def __int__(self):
        return int(self.__ref__())

    def __long__(self):
        return long(self.__ref__())
               ^
------------------------------------------------------------
kivy/weakproxy.pyx:257:15: undeclared name not builtin: long

Additional context Add any other context about the problem here.

EDIT: This issue seems fixed by https://github.com/kivy/kivy/commit/5a1b27d7d3bdee6cedb55440bfae9c4e66fb3c68 from 10 months ago, changing this to a new release plea then...