kivy / python-for-android

Turn your Python application into an Android APK
https://python-for-android.readthedocs.io
MIT License
8.18k stars 1.83k forks source link

buildozer rjnius/jnius.c:196:12: fatal error: 'longintrepr.h' file not found #2977

Open Sytse45 opened 5 months ago

Sytse45 commented 5 months ago

Software Versions

Describe the bug After buildozer failed in updating my PyQRS program (in contrast to one month ago), I narrowed the problem down to the following:
buildozer -v android debug fails to produce an .apk file from the simple kivy app 'pong' and with the default buildozer.spec file (from buildozer version 1.5.0).

Expected behavior I expect to find an .apk file as a result.

To Reproduce A simple kivy app (Pong, see next section) runs ok when issuing the command python3 main.py, but buildozer fails with the fatal error: jnius/jnius.c:196:12: fatal error: 'longintrepr.h' file not found.
In the buildozer.spec file, generated by buildozer 1.5.0, I only changed the first two uncommented lines into title = Pong and package.name = pong.

Code and Logs and screenshots The file main.py for the kivy app 'Pong' (without a pong.kv file):

from kivy.app import App
from kivy.uix.widget import Widget

class PongGame(Widget):
    pass

class PongApp(App):
    def build(self):
        return PongGame()

if __name__ == '__main__':
    PongApp().run()

The last relevant output lines:

[INFO]:    Building pyjnius for arm64-v8a
[INFO]:    jnius apparently isn't already in site-packages
[INFO]:    Cythonizing anything necessary in pyjnius
[DEBUG]:   Create directory /home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/pyjnius-sdl2/arm64-v8a__ndk_target_21/objects_pyjnius
[INFO]:    -> directory context /home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/pyjnius-sdl2/arm64-v8a__ndk_target_21/pyjnius
[DEBUG]:   -> running python3 -c import sys; print(sys.path)
[DEBUG]:    ['', '/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib', '/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages', '/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/build/temp.linux-x86_64-3.11', '/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/build/scripts-3.11', '/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/build/lib.linux-x86_64-3.11', '/usr/local/lib/python311.zip', '/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Lib']
[DEBUG]:   cwd is /home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/pyjnius-sdl2/arm64-v8a__ndk_target_21/pyjnius
[INFO]:    Trying first build of pyjnius to get cython files: this is expected to fail
[DEBUG]:   -> running python3 setup.py build_ext -v
[DEBUG]:    warning: [options] bootstrap class path not set in conjunction with -source 8
[DEBUG]:    1 warning
[DEBUG]:    running build_ext
[DEBUG]:    building 'jnius' extension
[DEBUG]:    creating build
[DEBUG]:    creating build/temp.linux-x86_64-3.11
[DEBUG]:    creating build/temp.linux-x86_64-3.11/jnius
[DEBUG]:    /home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include -DANDROID -I/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/pong/arm64-v8a/include/python3.1 -fPIC -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build -c jnius/jnius.c -o build/temp.linux-x86_64-3.11/jnius/jnius.o
[DEBUG]:    clang-14: error: no such file or directory: 'jnius/jnius.c'
[DEBUG]:    clang-14: error: no input files
[DEBUG]:    error: command '/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit code 1
Exception in thread background thread for pid 45265:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.9/threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "/home/sytse/.local/lib/python3.9/site-packages/sh.py", line 1641, in wrap
    fn(*rgs, **kwargs)
  File "/home/sytse/.local/lib/python3.9/site-packages/sh.py", line 2569, in background_thread
    handle_exit_code(exit_code)
  File "/home/sytse/.local/lib/python3.9/site-packages/sh.py", line 2269, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/sytse/.local/lib/python3.9/site-packages/sh.py", line 869, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v

  STDOUT:
warning: [options] bootstrap class path not set in conjunction with -source 8
1 warning
running build_ext
building 'jnius' extension
creating build
creating build/temp.linux-x86_64-3.11
creating build/temp.linux-x86_64-3.11/jnius
/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include -DANDROID -I/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/pong/arm64-v8a/include/python3.1 -fPIC -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build -c jnius/jnius.c -o build/temp.linux-x86_64-3.11/jnius/jnius.o
clang-14: error: no such file or directory: 'jnius/jnius.c'
clang-14: error: no input files
error: command '/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit code 1

  STDERR:

[INFO]:    pyjnius first build failed (as expected)
[INFO]:    Running cython where appropriate
[INFO]:    Cythonize jnius/jnius.pyx
[DEBUG]:   -> running python3 -cimport sys; from Cython.Compiler.Main import setuptools_main; sys.exit(setuptools_main()); ./jnius/jnius.pyx
[DEBUG]:    /home/sytse/.local/lib/python3.9/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/pyjnius-sdl2/arm64-v8a__ndk_target_21/pyjnius/jnius/jnius.pyx
[DEBUG]:      tree = Parsing.p_module(s, pxd, full_module_name)
[DEBUG]:   -> running python3 setup.py build_ext -v
[DEBUG]:    warning: [options] bootstrap class path not set in conjunction with -source 8
[DEBUG]:    1 warning
[DEBUG]:    running build_ext
[DEBUG]:    building 'jnius' extension
[DEBUG]:    /home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include -DANDROID -I/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/pong/arm64-v8a/include/python3.1 -fPIC -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build -c jnius/jnius.c -o build/temp.linux-x86_64-3.11/jnius/jnius.o
[DEBUG]:    jnius/jnius.c:196:12: fatal error: 'longintrepr.h' file not found
[DEBUG]:      #include "longintrepr.h"
[DEBUG]:               ^~~~~~~~~~~~~~~
[DEBUG]:    1 error generated.
[DEBUG]:    error: command '/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit code 1
Exception in thread background thread for pid 45307:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.9/threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "/home/sytse/.local/lib/python3.9/site-packages/sh.py", line 1641, in wrap
    fn(*rgs, **kwargs)
  File "/home/sytse/.local/lib/python3.9/site-packages/sh.py", line 2569, in background_thread
    handle_exit_code(exit_code)
  File "/home/sytse/.local/lib/python3.9/site-packages/sh.py", line 2269, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/sytse/.local/lib/python3.9/site-packages/sh.py", line 869, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v

  STDOUT:
warning: [options] bootstrap class path not set in conjunction with -source 8
1 warning
running build_ext
building 'jnius' extension
/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include -DANDROID -I/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/pong/arm64-v8a/include/python3.1 -fPIC -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build -c jnius/jnius.c -o build/temp.linux-x86_64-3.11/jnius/jnius.o
jnius/jnius.c:196:12: fatal error: 'longintrepr.h' file not found
  #include "longintrepr.h"
           ^~~~~~~~~~~~~~~
1 error generated.
error: command '/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit code 1

  STDERR:

[INFO]:    STDOUT:
    warning: [options] bootstrap class path not set in conjunction with -source 8   
1 warning   
running build_ext   
building 'jnius' extension  
/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include -DANDROID -I/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/pong/arm64-v8a/include/python3.1 -fPIC -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build -c jnius/jnius.c -o build/temp.linux-x86_64-3.11/jnius/jnius.o 
jnius/jnius.c:196:12: fatal error: 'longintrepr.h' file not found   
  #include "longintrepr.h"  
           ^~~~~~~~~~~~~~~  
1 error generated.  
error: command '/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit code 1
[INFO]:    STDERR:

[INFO]:    ENV:
export HOME='/home/sytse'
export CFLAGS='-target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include'
export CXXFLAGS='-target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC'
export CPPFLAGS='-DANDROID -I/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/pong/arm64-v8a/include/python3.1'
export LDFLAGS='  -L/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/libs_collections/pong/arm64-v8a -L/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/android-build -lpython3.11 -L/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/libs_collections/pong/arm64-v8a -L/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/libs_collections/pong  -L/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/obj/local/arm64-v8a '
export LDLIBS='-lm'
export PATH='/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin:/home/sytse/.buildozer/android/platform/android-ndk-r25b:/home/sytse/.buildozer/android/platform/android-sdk/tools:/home/sytse/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/sytse/Software/context/tex/texmf-linux-64/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/sytse/.local/bin/'
export CC='/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC'
export CXX='/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC'
export AR='/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar'
export RANLIB='/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib'
export STRIP='/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --strip-unneeded'
export READELF='/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-readelf'
export OBJCOPY='/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-objcopy'
export MAKE='make -j4'
export ARCH='arm64-v8a'
export NDK_API='android-21'
export LDSHARED='/home/sytse/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -shared'
export BUILDLIB_PATH='/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/build/lib.linux-x86_64-3.11'
export PYTHONNOUSERSITE='1'
export LANG='en_GB.UTF-8'
export PYTHONPATH='/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib:/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages:/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/build/temp.linux-x86_64-3.11:/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/build/scripts-3.11:/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/build/lib.linux-x86_64-3.11'
export LIBLINK='NOTNONE'
export COPYLIBS='1'
export LIBLINK_PATH='/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/pyjnius-sdl2/arm64-v8a__ndk_target_21/objects_pyjnius'
export NDKPLATFORM='NOTNONE'

[INFO]:    COMMAND:
cd /home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/pyjnius-sdl2/arm64-v8a__ndk_target_21/pyjnius && /home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v

[WARNING]: ERROR: /home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 failed!

Last part of the log file:

# Command failed: ['/usr/bin/python3', '-m', 'pythonforandroid.toolchain', 'create', '--dist_name=pong', '--bootstrap=sdl2', '--requirements=python3,kivy', '--arch=arm64-v8a', '--arch=armeabi-v7a', '--copy-libs', '--color=always', '--storage-dir=/home/sytse/Rommel/pong/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a', '--ndk-api=21', '--ignore-setup-py', '--debug']
# ENVIRONMENT:
#     SHELL = '/bin/bash'
#     SESSION_MANAGER = 'local/zbox-pep:@/tmp/.ICE-unix/776,unix/zbox-pep:/tmp/.ICE-unix/776'
#     WINDOWID = '79691779'
#     QT_ACCESSIBILITY = '1'
#     COLORTERM = 'truecolor'
#     XDG_CONFIG_DIRS = '/etc/xdg'
#     XDG_SESSION_PATH = '/org/freedesktop/DisplayManager/Session0'
#     XDG_MENU_PREFIX = 'xfce-'
#     TEXROOT = '/usr/local/context/tex'
#     LC_ADDRESS = 'nl_NL.UTF-8'
#     LC_NAME = 'nl_NL.UTF-8'
#     SSH_AUTH_SOCK = '/tmp/ssh-sokS1bSyua70/agent.776'
#     DESKTOP_SESSION = 'xfce'
#     LC_MONETARY = 'nl_NL.UTF-8'
#     SSH_AGENT_PID = '983'
#     XDG_SEAT = 'seat0'
#     PWD = '/home/sytse/Rommel/pong'
#     GSETTINGS_SCHEMA_DIR = '/home/sytse/data'
#     LOGNAME = 'sytse'
#     XDG_SESSION_DESKTOP = 'xfce'
#     XDG_SESSION_TYPE = 'x11'
#     XAUTHORITY = '/home/sytse/.Xauthority'
#     XDG_GREETER_DATA_DIR = '/var/lib/lightdm/data/sytse'
#     HOME = '/home/sytse'
#     LC_PAPER = 'nl_NL.UTF-8'
#     LANG = 'en_GB.UTF-8'
#     LS_COLORS = 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:'
#     XDG_CURRENT_DESKTOP = 'XFCE'
#     VTE_VERSION = '6203'
#     XDG_SEAT_PATH = '/org/freedesktop/DisplayManager/Seat0'
#     XDG_SESSION_CLASS = 'user'
#     LC_IDENTIFICATION = 'nl_NL.UTF-8'
#     TERM = 'xterm-256color'
#     USER = 'sytse'
#     DISPLAY = ':0.0'
#     SHLVL = '1'
#     LC_TELEPHONE = 'nl_NL.UTF-8'
#     LC_MEASUREMENT = 'nl_NL.UTF-8'
#     XDG_VTNR = '7'
#     XDG_SESSION_ID = '1'
#     XDG_RUNTIME_DIR = '/run/user/1000'
#     LC_TIME = 'nl_NL.UTF-8'
#     GTK3_MODULES = 'xapp-gtk3-module'
#     XDG_DATA_DIRS = '/usr/share/xfce4:/home/sytse/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/usr/share'
#     PATH = '/home/sytse/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/sytse/Software/context/tex/texmf-linux-64/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/sytse/.local/bin/'
#     GDMSESSION = 'xfce'
#     DBUS_SESSION_BUS_ADDRESS = 'unix:path=/run/user/1000/bus'
#     OSFONTDIR = '/home/sytse/.fonts:/usr/share/fonts'
#     GIO_LAUNCHED_DESKTOP_FILE_PID = '7637'
#     GIO_LAUNCHED_DESKTOP_FILE = '/usr/share/applications/xfce4-terminal.desktop'
#     LC_NUMERIC = 'nl_NL.UTF-8'
#     OLDPWD = '/home/sytse'
#     _ = '/home/sytse/.local/bin/buildozer'
#     PACKAGES_PATH = '/home/sytse/.buildozer/android/packages'
#     ANDROIDSDK = '/home/sytse/.buildozer/android/platform/android-sdk'
#     ANDROIDNDK = '/home/sytse/.buildozer/android/platform/android-ndk-r25b'
#     ANDROIDAPI = '31'
#     ANDROIDMINAPI = '21'
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

Additional context Searching on internet brought me to https://stackoverflow.com/questions/74979674/gensim-install-in-python-3-11-fails-because-of-missing-longintrepr-h-file, where a missing longintrepr.h file was attributed to the use of python 3.11.

Blobinius commented 5 months ago

I got the same error message and I am using Python version 3.12.2. For me, Pygame can't be compiled because it doesn't find longintrepr.h.

misl6 commented 5 months ago

Moved to kivy/python-for-android as is the right place for this discussion.

@Sytse45 @Blobinius this is not happening on our CI and my side, can you please confirm that python-for-android dependencies has been installed as per these docs?

Can you please also confirm your Cython version and if you're running buildozer (or p4a) from a virtual environment?

coquepas commented 4 months ago

I have the same issue with python 3.8, jnius cannot compile. in my spec i have the following requirements: requirements = python3,flask,flask-mobility,werkzeug==2.3.7,Cython==0.29.33,flask-sqlalchemy==2.5.0,sqlalchemy,flask-wtf,wtforms,pytest

GustavWebCriador commented 3 months ago

Hi, did anyone manage to solve it? because I believe I have the same problem

v-2841 commented 3 months ago

Found a temporary solution pip3 install --user --upgrade Cython==0.29.33 virtualenv And in spec: requirements = python3==3.10.12,kivy==2.3.0,hostpython3==3.10.12,pyjnius==1.5.0 osx.python_version = 3.10.12 osx.kivy_version = 2.3.0

OR

Install buildozer not with pipy repository but pip install https://github.com/kivy/buildozer/archive/master.zip Than it works without any changes in spec file

DayLon907 commented 3 months ago

hello, i think i have the same problem, i tried executing the commands (in google colab) but got no results, has anyone got another solution? thanks

Marcinosoft commented 3 months ago

Make sure that you are using latest Buildozer, currently 1.5.0. To check: buildozer --version

If not please update Buildozer and dependencies:

pip3 install --user --upgrade Cython==0.29.33 virtualenv
pip3 install --user --upgrade buildozer
DayLon907 commented 3 months ago

hello, i found a solution in google colab:

i wasn't doing the export path thing, here's a way without it:

instead of doing "buildozer init" or "buildozer android debug", do:

/root/.local/bin/buildozer init /root/.local/bin/buildozer android debug

i didn't do the export path cause im a bit newbie sorry, that is a solution to not do the export path

psydox commented 3 months ago

I'm having the same issue with the "longintrepr.h", but mine is caused by SDL2.

psydox commented 3 months ago

Found a temporary solution pip3 install --user --upgrade Cython==0.29.33 virtualenv And in spec: requirements = python3==3.10.12,kivy==2.3.0,hostpython3==3.10.12,pyjnius==1.5.0 osx.python_version = 3.10.12 osx.kivy_version = 2.3.0

OR

Install buildozer not with pipy repository but pip install https://github.com/kivy/buildozer/archive/master.zip Than it works without any changes in spec file

I was able to address the "longintrepr.h" issue and build PyGame by changing the requirements to python3==3.10.12,kivy==2.3.0,hostpython3==3.10.12,pyjnius==1.5.0

Thanks!