Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Cythonize pyjnius: TypeError: can't pickle Argument objects #850

Closed
nametoolong opened this issue Mar 9, 2019 · 2 comments
Closed

Comments

@nametoolong
Copy link

Versions

  • Python: 3.6.7
  • OS: KDE Neon latest (Ubuntu 18.04) amd64
  • Buildozer: 0.39

Description

buildozer android debug weirdly fails at Cythonize jnius/jnius.pyx.

buildozer.spec

Command:

buildozer -v android debug

Spec file: the default spec file just created by buildozer init.

Logs

("nonexistent" is my user name. Maybe I am to blame for that.)

# 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
# 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-8-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool
# Install platform
# 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"\''
# Cwd None
# Apache ANT found at /home/nonexistent/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/nonexistent/.buildozer/android/platform/android-sdk
# Android NDK found at /home/nonexistent/.buildozer/android/platform/android-ndk-r17c
# Read available permissions from api-versions.xml
# Check application requirements
# Check garden requirements
# Compile platform
# Run '/usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/nonexistent/project/.buildozer/android/platform/build" --ndk-api=21'
# Cwd /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Will compile for the following archs: armeabi-v7a
[INFO]:    Found Android API target in $ANDROIDAPI: 27
[INFO]:    Available Android APIs are (27)
[INFO]:    Requested API target 27 is available, continuing.
[INFO]:    Found NDK dir in $ANDROIDNDK: /home/nonexistent/.buildozer/android/platform/android-ndk-r17c
[INFO]:    Found NDK revision 17.2.4988734
[INFO]:    Getting NDK API version (i.e. minimum supported API) from user argument
[INFO]:    Found virtualenv at /usr/local/bin/virtualenv
[INFO]:    Found the following toolchain versions: ['4.9']
[INFO]:    Picking the latest gcc toolchain, here 4.9
[INFO]:    No existing dists meet the given requirements!
[INFO]:    No dist exists that meets your requirements, so one will be built.
[INFO]:    Found a single valid recipe set: ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'six', 'pyjnius', 'android', 'kivy']
[INFO]:    The selected bootstrap is sdl2
[INFO]:    # Creating dist with sdl2 bootstrap
[INFO]:    Dist will have name myapp and requirements (python3, kivy)
[INFO]:    Dist contains the following requirements as recipes: ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'six', 'pyjnius', 'android', 'kivy']
[INFO]:    Dist will also contain modules () installed from pip
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Recipe build order is ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'six', 'pyjnius', 'android', 'kivy']
[INFO]:    # Downloading recipes 
[INFO]:    Downloading hostpython3
[INFO]:    -> running mkdir -p /home/nonexistent/project/.buildozer/android/platform/build/packages/hostpython3
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/packages/hostpython3
[INFO]:    -> running basename https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
[INFO]:    hostpython3 download already cached, skipping                                                                                                                          
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Downloading libffi
[INFO]:    -> running mkdir -p /home/nonexistent/project/.buildozer/android/platform/build/packages/libffi
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/packages/libffi
[INFO]:    -> running basename https://github.com/libffi/libffi/archive/v3.2.1.tar.gz
[INFO]:    libffi download already cached, skipping                                                                                                                               
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Downloading openssl
[INFO]:    -> running mkdir -p /home/nonexistent/project/.buildozer/android/platform/build/packages/openssl
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/packages/openssl
[INFO]:    -> running basename https://www.openssl.org/source/openssl-1.1.1.tar.gz
[INFO]:    openssl download already cached, skipping                                                                                                                              
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Downloading sdl2_image
[INFO]:    -> running mkdir -p /home/nonexistent/project/.buildozer/android/platform/build/packages/sdl2_image
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/packages/sdl2_image
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.4.tar.gz
[INFO]:    sdl2_image download already cached, skipping                                                                                                                           
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Downloading sdl2_mixer
[INFO]:    -> running mkdir -p /home/nonexistent/project/.buildozer/android/platform/build/packages/sdl2_mixer
[INFO]:    -> directory context /home/nonexistent/project/.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/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Downloading sdl2_ttf
[INFO]:    -> running mkdir -p /home/nonexistent/project/.buildozer/android/platform/build/packages/sdl2_ttf
[INFO]:    -> directory context /home/nonexistent/project/.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/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Downloading sqlite3
[INFO]:    -> running mkdir -p /home/nonexistent/project/.buildozer/android/platform/build/packages/sqlite3
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/packages/sqlite3
[INFO]:    -> running basename https://www.sqlite.org/2016/sqlite-amalgamation-3150100.zip
[INFO]:    sqlite3 download already cached, skipping                                                                                                                              
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Downloading python3
[INFO]:    -> running mkdir -p /home/nonexistent/project/.buildozer/android/platform/build/packages/python3
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/packages/python3
[INFO]:    -> running basename https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
[INFO]:    python3 download already cached, skipping                                                                                                                              
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Downloading sdl2
[INFO]:    -> running mkdir -p /home/nonexistent/project/.buildozer/android/platform/build/packages/sdl2
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/packages/sdl2
[INFO]:    -> running basename https://www.libsdl.org/release/SDL2-2.0.9.tar.gz
[INFO]:    sdl2 download already cached, skipping                                                                                                                                 
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Downloading six
[INFO]:    -> running mkdir -p /home/nonexistent/project/.buildozer/android/platform/build/packages/six
[INFO]:    -> directory context /home/nonexistent/project/.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/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Downloading pyjnius
[INFO]:    -> running mkdir -p /home/nonexistent/project/.buildozer/android/platform/build/packages/pyjnius
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/packages/pyjnius
[INFO]:    -> running basename https://github.com/kivy/pyjnius/archive/6553ad4.zip
[INFO]:    pyjnius download already cached, skipping                                                                                                                              
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Downloading android
[INFO]:    Skipping android download as no URL is set
[INFO]:    Downloading kivy
[INFO]:    -> running mkdir -p /home/nonexistent/project/.buildozer/android/platform/build/packages/kivy
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/packages/kivy
[INFO]:    -> running basename https://github.com/kivy/kivy/archive/a95d67f.zip
[INFO]:    kivy download already cached, skipping                                                                                                                                 
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    # Building all recipes for arch armeabi-v7a
[INFO]:    # Unpacking recipes
[INFO]:    Unpacking hostpython3 for armeabi-v7a
[INFO]:    -> running basename https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop                                                
[INFO]:    hostpython3 is already unpacked, skipping
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking libffi for armeabi-v7a
[INFO]:    -> running basename https://github.com/libffi/libffi/archive/v3.2.1.tar.gz
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21                                  
[INFO]:    libffi is already unpacked, skipping
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking openssl for armeabi-v7a
[INFO]:    -> running basename https://www.openssl.org/source/openssl-1.1.1.tar.gz
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a__ndk_target_21                                 
[INFO]:    openssl is already unpacked, skipping
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking sdl2_image for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.4.tar.gz
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni                                               
[INFO]:    sdl2_image is already unpacked, skipping
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[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/nonexistent/project/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni                                               
[INFO]:    sdl2_mixer is already unpacked, skipping
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[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/nonexistent/project/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni                                               
[INFO]:    sdl2_ttf is already unpacked, skipping
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking sqlite3 for armeabi-v7a
[INFO]:    -> running basename https://www.sqlite.org/2016/sqlite-amalgamation-3150100.zip
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21                                 
[INFO]:    sqlite3 is already unpacked, skipping
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking python3 for armeabi-v7a
[INFO]:    -> running basename https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21          
[INFO]:    python3 is already unpacked, skipping
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking sdl2 for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/release/SDL2-2.0.9.tar.gz
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni                                               
[INFO]:    sdl2 is already unpacked, skipping
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[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/nonexistent/project/.buildozer/android/platform/build/build/other_builds/six-python3/armeabi-v7a__ndk_target_21                             
[INFO]:    six is already unpacked, skipping
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking pyjnius for armeabi-v7a
[INFO]:    -> running basename https://github.com/kivy/pyjnius/archive/6553ad4.zip
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/build/other_builds/pyjnius-python3-sdl2/armeabi-v7a__ndk_target_21                    
[INFO]:    pyjnius is already unpacked, skipping
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    -> running rm -rf /home/nonexistent/project/.buildozer/android/platform/build/build/other_builds/android-python3-sdl2/armeabi-v7a__ndk_target_21/android
[INFO]:    -> running cp -a /home/nonexistent/project/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/android/src /home/nonexis...(and 121 more)
[INFO]:    Unpacking kivy for armeabi-v7a
[INFO]:    -> running basename https://github.com/kivy/kivy/archive/a95d67f.zip
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/build/other_builds/kivy-python3-sdl2/armeabi-v7a__ndk_target_21                       
[INFO]:    kivy is already unpacked, skipping
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    # Prebuilding recipes
[INFO]:    Prebuilding hostpython3 for armeabi-v7a
[INFO]:    hostpython3 has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding libffi for armeabi-v7a
[INFO]:    libffi has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for libffi[armeabi-v7a]
[INFO]:    libffi already patched, skipping
[INFO]:    Prebuilding openssl for armeabi-v7a
[INFO]:    openssl has no prebuild_armeabi_v7a, skipping
[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 sqlite3 for armeabi-v7a
[INFO]:    sqlite3 has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding python3 for armeabi-v7a
[INFO]:    python3 has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for python3[armeabi-v7a]
[INFO]:    python3 already patched, skipping
[INFO]:    Prebuilding sdl2 for armeabi-v7a
[INFO]:    sdl2 has no prebuild_armeabi_v7a, 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 android for armeabi-v7a
[INFO]:    android has no prebuild_armeabi_v7a, skipping
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/build/other_builds/android-python3-sdl2/armeabi-v7a__ndk_target_21/android
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Prebuilding kivy for armeabi-v7a
[INFO]:    kivy has no prebuild_armeabi_v7a, skipping
[INFO]:    # Building recipes
[INFO]:    Building hostpython3 for armeabi-v7a
[INFO]:    Skipping hostpython3 (3.7.1) build, as it has already been completed
[INFO]:    Building libffi for armeabi-v7a
[INFO]:    libffi said it is already built, skipping
[INFO]:    Building openssl for armeabi-v7a
[INFO]:    openssl said it is already built, skipping
[INFO]:    Building sdl2_image for armeabi-v7a
[INFO]:    Building sdl2_mixer for armeabi-v7a
[INFO]:    Building sdl2_ttf for armeabi-v7a
[INFO]:    Building sqlite3 for armeabi-v7a
[INFO]:    sqlite3 said it is already built, skipping
[INFO]:    Building python3 for armeabi-v7a
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21/python3/android-build                                                                                                                                                                        
[WARNING]: Doing some hacky stuff to link properly
[INFO]:    -> running cp /home/nonexistent/.buildozer/android/platform/android-ndk-r17c/platforms/android-21/arch-arm/usr/lib/crtbegin_so.o ./
[INFO]:    -> running cp /home/nonexistent/.buildozer/android/platform/android-ndk-r17c/platforms/android-21/arch-arm/usr/lib/crtend_so.o ./
[INFO]:    Activating flags for sqlite3
[INFO]:    Activating flags for libffi
[INFO]:    Activating flags for openssl
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android
[INFO]:    Building sdl2 for armeabi-v7a
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni
[INFO]:    -> running ndk-build V=1
[INFO]:    <- directory context /home/nonexistent/project/.buildozer/android/platform/python-for-android                                                                          
[INFO]:    Building six for armeabi-v7a
[INFO]:    Python package already exists in site-packages
[INFO]:    six said it is already built, skipping
[INFO]:    Building pyjnius for armeabi-v7a
[INFO]:    jnius apparently isn't already in site-packages
[INFO]:    Cythonizing anything necessary in pyjnius
[INFO]:    -> directory context /home/nonexistent/project/.buildozer/android/platform/build/build/other_builds/pyjnius-python3-sdl2/armeabi-v7a__ndk_target_21/pyjnius
[INFO]:    -> running python -c import sys; print(sys.path)
[INFO]:    Trying first build of pyjnius to get cython files: this is expected to fail                                                                                            
[INFO]:    -> running python setup.py build_ext -v
cwd is /home/nonexistent/project/.buildozer/android/platform/build/build/other_builds/pyjnius-python3-sdl2/armeabi-v7a__ndk_target_21/pyjnius
Exception in thread background thread for pid 20267:                                                                                                                              
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/nonexistent/.local/lib/python3.6/site-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/home/nonexistent/.local/lib/python3.6/site-packages/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/home/nonexistent/.local/lib/python3.6/site-packages/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/nonexistent/.local/lib/python3.6/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /home/nonexistent/project/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/native-build/python setup.py build_ext -v

  STDOUT:
/home/nonexistent/project/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/Lib/distutils/dist.py:274: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
running build_ext
building 'jnius' extension
/usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -fomit-frame-pointer -D__ANDROID_API__=21 -mandroid -isystem /home/nonexistent/.buildozer/android/platform/android-ndk-r17c/sysroot/usr/include/arm-linux-androideabi -I/home/nonexistent/.buildozer/android/platform/android-ndk-r17c/sysroot/usr/include/arm-linux-androideabi -isysroot /home/nonexistent/.buildozer/android/platform/android-ndk-r17c/sysroot -I/home/nonexistent/project/.buildozer/android/platform/build/build/python-installs/myapp/include/python3.7 -DNDEBUG -g -fwrapv -O3 -Wall -DANDROID -fomit-frame-pointer -D__ANDROID_API__=21 -mandroid -isystem /home/nonexistent/.buildozer/android/platform/android-ndk-r17c/sysroot/usr/include/arm-linux-androideabi -I/home/nonexistent/.buildozer/android/platform/android-ndk-r17c/sysroot/usr/include/arm-linux-androideabi -isysroot /home/nonexistent/.buildozer/android/platform/android-ndk-r17c/sysroot -I/home/nonexistent/project/.buildozer/android/platform/build/build/python-installs/myapp/include/python3.7 -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -I/home/nonexistent/project/.buildozer/android/platform/build/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21/python3/Include -fPIC -I/home/nonexistent/project/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/nonexistent/project/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/native-build -c jnius/jnius.c -o build/temp.linux-x86_64-3.7/jnius/jnius.o
arm-linux-androideabi-gcc: error: jnius/jnius.c: No such file or directory
arm-linux-androideabi-gcc: fatal error: no input files
compilation terminated.
error: command '/usr/bin/ccache' failed with exit status 1


  STDERR:


[INFO]:    pyjnius first build failed (as expected)
[INFO]:    Running cython where appropriate
[INFO]:    Cythonize jnius/jnius.pyx
[INFO]:    -> running cython ./jnius/jnius.pyx

Exception in thread background thread for pid 20274:                                                                                                                              
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/nonexistent/.local/lib/python3.6/site-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/home/nonexistent/.local/lib/python3.6/site-packages/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/home/nonexistent/.local/lib/python3.6/site-packages/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/nonexistent/.local/lib/python3.6/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /usr/local/bin/cython ./jnius/jnius.pyx

  STDOUT:
Traceback (most recent call last):
  File "/usr/local/bin/cython", line 11, in <module>
    load_entry_point('Cython==0.21', 'console_scripts', 'cython')()
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Main.py", line 632, in setuptools_main
    return main(command_line = 1)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Main.py", line 649, in main
    result = compile(sources, options)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Main.py", line 624, in compile
    return compile_multiple(source, options)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Main.py", line 602, in compile_multiple
    result = run_pipeline(source, options, context=context)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Main.py", line 439, in run_pipeline
    err, enddata = Pipeline.run_pipeline(pipeline, source)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Pipeline.py", line 328, in run_pipeline
    data = phase(data)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Pipeline.py", line 54, in generate_pyx_code_stage
    module_node.process_implementation(options, result)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/ModuleNode.py", line 111, in process_implementation
    self.generate_c_code(env, options, result)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/ModuleNode.py", line 328, in generate_c_code
    self.body.generate_function_definitions(env, code)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Nodes.py", line 398, in generate_function_definitions
    stat.generate_function_definitions(env, code)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Nodes.py", line 398, in generate_function_definitions
    stat.generate_function_definitions(env, code)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Nodes.py", line 1859, in generate_function_definitions
    self.generate_function_body(env, code)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Nodes.py", line 1628, in generate_function_body
    self.body.generate_execution_code(code)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Nodes.py", line 404, in generate_execution_code
    stat.generate_execution_code(code)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Nodes.py", line 6610, in generate_execution_code
    fresh_finally_clause().generate_execution_code(code)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Nodes.py", line 6598, in fresh_finally_clause
    node_copy = copy.deepcopy(node)
  File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.6/copy.py", line 215, in _deepcopy_list
    append(deepcopy(a, memo))
  File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/lib/python3.6/copy.py", line 297, in _reconstruct
    item = deepcopy(item, memo)
  File "/usr/lib/python3.6/copy.py", line 169, in deepcopy
    rv = reductor(4)
TypeError: can't pickle Argument objects


  STDERR:


Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/nonexistent/project/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1081, in <module>
    main()
  File "/home/nonexistent/project/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1075, in main
    ToolchainCL()
  File "/home/nonexistent/project/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 577, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/nonexistent/project/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 151, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/nonexistent/project/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 200, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "/home/nonexistent/project/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 562, in build_recipes
    recipe.build_arch(arch)
  File "/home/nonexistent/project/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 982, in build_arch
    self.build_cython_components(arch)
  File "/home/nonexistent/project/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1007, in build_cython_components
    self.cythonize_build(env=env)
  File "/home/nonexistent/project/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1057, in cythonize_build
    self.cythonize_file(env, build_dir, join(root, filename))
  File "/home/nonexistent/project/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1048, in cythonize_file
    shprint(cython_command, filename, *self.cython_args, _env=cyenv)
  File "/home/nonexistent/project/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 178, in shprint
    for line in output:
  File "/home/nonexistent/.local/lib/python3.6/site-packages/sh.py", line 863, in next
    self.wait()
  File "/home/nonexistent/.local/lib/python3.6/site-packages/sh.py", line 792, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/nonexistent/.local/lib/python3.6/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /usr/local/bin/cython ./jnius/jnius.pyx

  STDOUT:
Traceback (most recent call last):
  File "/usr/local/bin/cython", line 11, in <module>
    load_entry_point('Cython==0.21', 'console_scripts', 'cython')()
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Main.py", line 632, in setuptools_main
    return main(command_line = 1)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Main.py", line 649, in main
    result = compile(sources, options)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Main.py", line 624, in compile
    return compile_multiple(source, options)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Main.py", line 602, in compile_multiple
    result = run_pipeline(source, options, context=context)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Main.py", line 439, in run_pipeline
    err, enddata = Pipeline.run_pipeline(pipeline, source)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Pipeline.py", line 328, in run_pipeline
    data = phase(data)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Pipeline.py", line 54, in generate_pyx_code_stage
    module_node.process_implementation(options, result)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/ModuleNode.py", line 111, in process_implementation
    self.generate_c_code(env, options, result)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/ModuleNode.py", line 328, in generate_c_code
    self.body.generate_function_definitions(env, code)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Nodes.py", line 398, in generate_function_definitions
    stat.generate_function_definitions(env, code)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Nodes.py", line 398, in generate_function_definitions
    stat.generate_function_definitions(env, code)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Nodes.py", line 1859, in generate_function_definitions
    self.generate_function_body(env, code)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Nodes.py", line 1628, in generate_function_body
    self.body.generate_execution_code(code)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Nodes.py", line 404, in generate_execution_code
    stat.generate_execution_code(code)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Nodes.py", line 6610, in generate_execution_code
    fresh_finally_clause().generate_execution_code(code)
  File "/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Nodes.py", line 6598, in fresh_finally_clause
    node_copy = copy.deepcopy(node)
  File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.6/copy.py", line 215, in _deepcopy_list
    append(deepcopy(a, memo))
  File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/lib/python3.6/copy.py", line 297, in _reconstruct
    item = deepcopy(item, memo)
  File "/usr/lib/python3.6/copy.py", line 169, in deepcopy
    rv = reductor(4)
TypeError: can't pickle Argument objects


  STDERR:

# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/nonexistent/project/.buildozer/android/platform/build" --ndk-api=21
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

@nametoolong
Copy link
Author

It works with a Cython built from the latest source. In the documentation there is

sudo pip install --upgrade cython==0.21

It may need an update to use cython==0.29.

@AndreMiras
Copy link
Member

Thanks for the bug report and the follow up.
Actually the documentation is up to date on the tree https://github.com/kivy/buildozer/blob/9229135/docs/source/installation.rst but it somehow didn't get published on readthedocs see #819
Let's keep this issue open until #819 is addressed.
By the way,, I would recommend you to use Cython 0.28 rather than 0.29, I saw compile time errors in the past with 0.29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants