kivy / buildozer

Generic Python packager for Android and iOS
https://buildozer.readthedocs.io
MIT License
1.71k stars 496 forks source link

Libffi not compiling (aarch64/arm64/armv8) #1281

Closed frak0d closed 2 years ago

frak0d commented 3 years ago

Versions

Description

I am trying to run Buildozer on arm64. After a lot of pain getting sdk,ndk and jdk to work on arm64, now i have another issue. I think libiffi is not compiling. Any help ?

BTW i am using SDK and NDK from Here :- https://github.com/Lzhiyong/termux-ndk

buildozer.spec

Command:

buildozer -v android debug

Spec file:

Default spec file with custom ndk and sdk path

Python File:

print("Testing")

Logs

# 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
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
/bin/sh: line 1: 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-15-openjdk/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-15-openjdk/bin/keytool
# Install platform
# Run 'git config --get remote.origin.url'
# Cwd /root/test/.buildozer/android/platform/python-for-android
https://github.com/kivy/python-for-android.git
# Run 'git branch -vv'
# Cwd /root/test/.buildozer/android/platform/python-for-android
* master 5a94d074 [origin/master] Merge pull request #2244 from Chronolife-team/native_services_upstream
# Run '/usr/bin/python -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/Android_Tools/android-sdk
# Android NDK found at /root/Android_Tools/android-ndk-r21d
# Recommended android's NDK version by p4a is: 19c
# Check application requirements
# Check garden requirements
# Compile platform
# Run '/usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3 --arch armeabi-v7a --copy-libs --color=always --storage-dir="/root/test/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21'
# Cwd /root/test/.buildozer/android/platform/python-for-android
/root/test/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py:84: 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: 27
[INFO]:    Available Android APIs are (27, 28, 29, 30)
[INFO]:    Requested API target 27 is available, continuing.
[INFO]:    Found NDK dir in $ANDROIDNDK: /root/Android_Tools/android-ndk-r21d
[INFO]:    Found NDK version 21d
[WARNING]: Maximum recommended NDK version is 19c, but newer versions may work.
[WARNING]: Newer NDKs may not be fully supported by p4a.
[INFO]:    Getting NDK API version (i.e. minimum supported API) from user argument
[INFO]:    ccache is missing, the build will not be optimized in the future.
[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', 'setuptools', 'six', 'pyjnius', 'android']
[INFO]:    The selected bootstrap is sdl2
[INFO]:    # Creating dist with sdl2 bootstrap
[INFO]:    Dist will have name myapp and requirements (python3)
[INFO]:    Dist contains the following requirements as recipes: ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'setuptools', 'six', 'pyjnius', 'android']
[INFO]:    Dist will also contain modules () installed from pip
[INFO]:    Dist will be build in mode debug
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/build/bootstrap_builds/sdl2
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Recipe build order is ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'setuptools', 'six', 'pyjnius', 'android']
[INFO]:    # Downloading recipes
[INFO]:    Downloading hostpython3
[INFO]:    -> running mkdir -p /root/test/.buildozer/andro...(and 50 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/packages/hostpython3
[INFO]:    -> running basename https://www.python.org/ftp/p...(and 28 more)
[INFO]:    hostpython3 download already cached, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Downloading libffi
[INFO]:    -> running mkdir -p /root/test/.buildozer/andro...(and 45 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/packages/libffi
[INFO]:    -> running basename https://github.com/libffi/li...(and 27 more)
[INFO]:    libffi download already cached, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Downloading openssl
[INFO]:    -> running mkdir -p /root/test/.buildozer/andro...(and 46 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/packages/openssl
[INFO]:    -> running basename https://www.openssl.org/sour...(and 24 more)
[INFO]:    openssl download already cached, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Downloading sdl2_image
[INFO]:    -> running mkdir -p /root/test/.buildozer/andro...(and 49 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/packages/sdl2_image
[INFO]:    -> running basename https://www.libsdl.org/proj...(and 46 more)
[INFO]:    sdl2_image download already cached, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Downloading sdl2_mixer
[INFO]:    -> running mkdir -p /root/test/.buildozer/andro...(and 49 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/packages/sdl2_mixer
[INFO]:    -> running basename https://www.libsdl.org/proj...(and 46 more)
[INFO]:    sdl2_mixer download already cached, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Downloading sdl2_ttf
[INFO]:    -> running mkdir -p /root/test/.buildozer/andro...(and 47 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/packages/sdl2_ttf
[INFO]:    -> running basename https://www.libsdl.org/proje...(and 42 more)
[INFO]:    sdl2_ttf download already cached, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Downloading sqlite3
[INFO]:    -> running mkdir -p /root/test/.buildozer/andro...(and 46 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/packages/sqlite3
[INFO]:    -> running basename https://www.sqlite.org/2016/...(and 31 more)
[INFO]:    sqlite3 download already cached, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Downloading python3
[INFO]:    -> running mkdir -p /root/test/.buildozer/andro...(and 46 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/packages/python3
[INFO]:    -> running basename https://www.python.org/ftp/p...(and 28 more)
[INFO]:    python3 download already cached, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Downloading sdl2
[INFO]:    -> running mkdir -p /root/test/.buildozer/androi...(and 42 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/packages/sdl2
[INFO]:    -> running basename https://www.libsdl.org/relea...(and 20 more)
[INFO]:    sdl2 download already cached, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Downloading setuptools
[INFO]:    -> running mkdir -p /root/test/.buildozer/andro...(and 49 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/packages/setuptools
[INFO]:    -> running basename https://pypi.python.org/pac...(and 47 more)
[INFO]:    setuptools download already cached, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Downloading six
[INFO]:    -> running mkdir -p /root/test/.buildozer/androi...(and 41 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/packages/six
[INFO]:    -> running basename https://pypi.python.org/pack...(and 35 more)
[INFO]:    six download already cached, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Downloading pyjnius
[INFO]:    -> running mkdir -p /root/test/.buildozer/andro...(and 46 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/packages/pyjnius
[INFO]:    -> running basename https://github.com/kivy/pyjn...(and 21 more)
[INFO]:    pyjnius download already cached, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Downloading android
[INFO]:    Skipping android download as no URL is set
[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/p...(and 28 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/hostpython3/desktop
[INFO]:    hostpython3 is already unpacked, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking libffi for armeabi-v7a
[INFO]:    -> running basename https://github.com/libffi/li...(and 27 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21
[INFO]:    libffi is already unpacked, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking openssl for armeabi-v7a
[INFO]:    -> running basename https://www.openssl.org/sour...(and 24 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/openssl/armeabi-v7a__ndk_target_21
[INFO]:    openssl is already unpacked, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking sdl2_image for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/proj...(and 46 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/build/bootstrap_builds/sdl2/jni
[INFO]:    sdl2_image is already unpacked, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking sdl2_mixer for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/proj...(and 46 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/build/bootstrap_builds/sdl2/jni
[INFO]:    sdl2_mixer is already unpacked, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking sdl2_ttf for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/proje...(and 42 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/build/bootstrap_builds/sdl2/jni
[INFO]:    sdl2_ttf is already unpacked, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking sqlite3 for armeabi-v7a
[INFO]:    -> running basename https://www.sqlite.org/2016/...(and 31 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21
[INFO]:    sqlite3 is already unpacked, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking python3 for armeabi-v7a
[INFO]:    -> running basename https://www.python.org/ftp/p...(and 28 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21
[INFO]:    python3 is already unpacked, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking sdl2 for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/relea...(and 20 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/build/bootstrap_builds/sdl2/jni
[INFO]:    sdl2 is already unpacked, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking setuptools for armeabi-v7a
[INFO]:    -> running basename https://pypi.python.org/pac...(and 47 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/setuptools/armeabi-v7a__ndk_target_21
[INFO]:    setuptools is already unpacked, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking six for armeabi-v7a
[INFO]:    -> running basename https://pypi.python.org/pack...(and 35 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/six/armeabi-v7a__ndk_target_21
[INFO]:    six is already unpacked, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    Unpacking pyjnius for armeabi-v7a
[INFO]:    -> running basename https://github.com/kivy/pyjn...(and 21 more)
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/pyjnius-sdl2/armeabi-v7a__ndk_target_21
[INFO]:    pyjnius is already unpacked, skipping
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    -> running rm -rf /root/test/.buildozer/android...(and 94 more)
[INFO]:    -> running cp -a /root/test/.buildozer/android/...(and 188 more)
[INFO]:    # Prebuilding recipes
[INFO]:    Prebuilding hostpython3 for armeabi-v7a
[INFO]:    hostpython3 has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for hostpython3[armeabi-v7a]
[INFO]:    hostpython3 already patched, 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 setuptools for armeabi-v7a
[INFO]:    setuptools 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 /root/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/android-sdl2/armeabi-v7a__ndk_target_21/android
[INFO]:    <- directory context /root/test/.buildozer/android/platform/python-for-android
[INFO]:    # Building recipes
[INFO]:    Building hostpython3 for armeabi-v7a
[INFO]:    hostpython3 said it is already built, skipping
[INFO]:    Building libffi for armeabi-v7a
[INFO]:    -> directory context /root/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi
[INFO]:    -> running autoreconf -vif
[INFO]:    -> running configure --host=arm-linux-androidea...(and 163 more)
           working: See `config.log' for more details                                Exception in thread background thread for pid 14933:
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 "/usr/lib/python3.9/site-packages/sh.py", line 1637, in wrap
    fn(*rgs, **kwargs)
  File "/usr/lib/python3.9/site-packages/sh.py", line 2561, in background_thread
    handle_exit_code(exit_code)
  File "/usr/lib/python3.9/site-packages/sh.py", line 2265, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/usr/lib/python3.9/site-packages/sh.py", line 865, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_77:

  RAN: /root/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/configure --host=arm-linux-androideabi --prefix=/root/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi --disable-builddir --enable-shared

  STDOUT:
checking build system type... aarch64-unknown-linux-gnu
checking host system type... arm-unknown-linux-androideabi
checking target system type... arm-unknown-linux-androideabi
checking for gsed... sed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-androideabi-strip... arm-linux-androideabi-strip --strip-unneeded
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make -j8 sets $(MAKE)... yes
checking whether make -j8 supports nested variables... yes
checking for arm-linux-androideabi-gcc... /root/Android_Tools/android-ndk-r21d/toolchains/llvm/prebuilt/linux-aarch64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC
checking whether the C compiler works... no
configure: error: in `/root/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi':
configure: error: C compiler cannot create executables
See `config.log' for more details

  STDERR:

Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/root/test/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1260, in <module>
    main()
  File "/root/test/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/root/test/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 709, in __init__
    getattr(self, command)(args)
  File "/root/test/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 154, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/root/test/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 213, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx,
  File "/root/test/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 577, in build_recipes
    recipe.build_arch(arch)
  File "/root/test/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/libffi/__init__.py", line 42, in build_arch
    shprint(sh.Command('./configure'),
  File "/root/test/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 167, in shprint
    for line in output:
  File "/usr/lib/python3.9/site-packages/sh.py", line 911, in next
    self.wait()
  File "/usr/lib/python3.9/site-packages/sh.py", line 841, in wait
    self.handle_command_exit_code(exit_code)
  File "/usr/lib/python3.9/site-packages/sh.py", line 865, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_77:

  RAN: /root/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/configure --host=arm-linux-androideabi --prefix=/root/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi --disable-builddir --enable-shared

  STDOUT:
checking build system type... aarch64-unknown-linux-gnu
checking host system type... arm-unknown-linux-androideabi
checking target system type... arm-unknown-linux-androideabi
checking for gsed... sed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-androideabi-strip... arm-linux-androideabi-strip --strip-unneeded
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make -j8 sets $(MAKE)... yes
checking whether make -j8 supports nested variables... yes
checking for arm-linux-androideabi-gcc... /root/Android_Tools/android-ndk-r21d/toolchains/llvm/prebuilt/linux-aarch64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC
checking whether the C compiler works... no
configure: error: in `/root/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi':
configure: error: C compiler cannot create executables
See `config.log' for more details

  STDERR:

# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3 --arch armeabi-v7a --copy-libs --color=always --storage-dir="/root/test/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21
# ENVIRONMENT:
#     LANGUAGE = 'en_IN.UTF-8'
#     LC_ADDRESS = 'en_IN.UTF-8'
#     LC_NAME = 'en_IN.UTF-8'
#     LC_MONETARY = 'en_IN.UTF-8'
#     GPG_TTY = '/dev/stderr'
#     PWD = '/root/test'
#     TZ = 'Asia/Calcutta'
#     HOME = '/root'
#     LC_PAPER = 'en_IN.UTF-8'
#     LANG = 'en_IN.UTF-8'
#     TMPDIR = '/tmp'
#     ANDROID_DATA = '/data'
#     LC_IDENTIFICATION = 'en_IN.UTF-8'
#     TERM = 'xterm-256color'
#     SHLVL = '1'
#     LC_TELEPHONE = 'en_IN.UTF-8'
#     LC_MESSAGES = 'en_IN.UTF-8'
#     LC_MEASUREMENT = 'en_IN.UTF-8'
#     LC_CTYPE = 'en_IN.UTF-8'
#     LC_TIME = 'en_IN.UTF-8'
#     LC_COLLATE = 'en_IN.UTF-8'
#     PATH = '/root/.buildozer/android/platform/apache-ant-1.9.4/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/sbin:/sbin:/bin'
#     LC_NUMERIC = 'en_IN.UTF-8'
#     OLDPWD = '/root'
#     _ = '/usr/bin/buildozer'
#     PACKAGES_PATH = '/root/.buildozer/android/packages'
#     ANDROIDSDK = '/root/Android_Tools/android-sdk'
#     ANDROIDNDK = '/root/Android_Tools/android-ndk-r21d'
#     ANDROIDAPI = '27'
#     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
pcgeek86 commented 2 years ago

Same issue here with WSL2 / Ubuntu 22.04 LTS

[INFO]:    Building libffi for arm64-v8a
[INFO]:    -> directory context /mnt/c/git/kivy/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/libffi/arm64-v8a__ndk_target_21/libffi
[DEBUG]:   -> running autogen.sh
[DEBUG]:        /mnt/c/git/kivy/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/libffi/arm64-v8a__ndk_target_21/libffi/autogen.sh: 2: exec: autoreconf: not found
Exception in thread background thread for pid 14763:
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 946, in run
    self._target(*self._args, **self._kwargs)
  File "/home/trevor/.local/lib/python3.10/site-packages/sh.py", line 1641, in wrap
    fn(*rgs, **kwargs)
  File "/home/trevor/.local/lib/python3.10/site-packages/sh.py", line 2569, in background_thread
    handle_exit_code(exit_code)
  File "/home/trevor/.local/lib/python3.10/site-packages/sh.py", line 2269, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/trevor/.local/lib/python3.10/site-packages/sh.py", line 869, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_127:

  RAN: /mnt/c/git/kivy/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/libffi/arm64-v8a__ndk_target_21/libffi/autogen.sh

  STDOUT:
/mnt/c/git/kivy/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/libffi/arm64-v8a__ndk_target_21/libffi/autogen.sh: 2: exec: autoreconf: not found

  STDERR:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/mnt/c/git/kivy/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1297, in <module>
    main()
  File "/mnt/c/git/kivy/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/mnt/c/git/kivy/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 731, in __init__
    getattr(self, command)(args)
  File "/mnt/c/git/kivy/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 154, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/mnt/c/git/kivy/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 213, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx,
  File "/mnt/c/git/kivy/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 505, in build_recipes
    recipe.build_arch(arch)
  File "/mnt/c/git/kivy/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/libffi/__init__.py", line 28, in build_arch
    shprint(sh.Command('./autogen.sh'), _env=env)
  File "/mnt/c/git/kivy/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 167, in shprint    for line in output:
  File "/home/trevor/.local/lib/python3.10/site-packages/sh.py", line 915, in next
    self.wait()
  File "/home/trevor/.local/lib/python3.10/site-packages/sh.py", line 845, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/trevor/.local/lib/python3.10/site-packages/sh.py", line 869, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_127:

  RAN: /mnt/c/git/kivy/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/libffi/arm64-v8a__ndk_target_21/libffi/autogen.sh

  STDOUT:
/mnt/c/git/kivy/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/libffi/arm64-v8a__ndk_target_21/libffi/autogen.sh: 2: exec: autoreconf: not found

  STDERR:

# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=trevorbuildozer --bootstrap=sdl2 --requirements=python3,kivy --arch arm64-v8a --arch armeabi-v7a --copy-libs --color=always --storage-dir="/mnt/c/git/kivy/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a" --ndk-api=21 --ignore-setup-py --debug
# ENVIRONMENT:
#     SHELL = '/bin/bash'
#     WSL2_GUI_APPS_ENABLED = '1'
#     WSL_DISTRO_NAME = 'Ubuntu-22.04'
#     NAME = 'artemis'
#     PWD = '/mnt/c/git/kivy'
#     LOGNAME = 'trevor'
#     MOTD_SHOWN = 'update-motd'
#     HOME = '/home/trevor'
#     LANG = 'en_US.UTF-8'
#     WSL_INTEROP = '/run/WSL/15_interop'
#     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:'
#     WAYLAND_DISPLAY = 'wayland-0'
#     LESSCLOSE = '/usr/bin/lesspipe %s %s'
#     TERM = 'xterm-256color'
#     LESSOPEN = '| /usr/bin/lesspipe %s'
#     USER = 'trevor'
#     DISPLAY = ':0'
#     SHLVL = '1'
#     XDG_RUNTIME_DIR = '/mnt/wslg/runtime-dir'
#     WSLENV = ''
#     XDG_DATA_DIRS = '/usr/local/share:/usr/share:/var/lib/snapd/desktop'
#     PATH = ('/home/trevor/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program '
 'Files (x86)/Common Files/Intel/Shared '
 'Libraries/redist/intel64/compiler:/mnt/c/Users/TrevorSullivan/scoop/apps/dotnet-sdk/current:/mnt/c/Program '
 'Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/bin:/mnt/c/Program '
 'Files/NVIDIA GPU Computing '
 'Toolkit/CUDA/v10.2/libnvvp:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program '
 'Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA '
 'Corporation/Nsight Compute 2019.5.0/:/mnt/c/Program '
 'Files/Intel/WiFi/bin/:/mnt/c/Program Files/Common '
 'Files/Intel/WirelessCommon/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program '
 'Files/dotnet/:/mnt/c/Program Files/Amazon/AWSSAMCLI/bin/:/mnt/c/Program '
 'Files/Amazon/SessionManagerPlugin/bin/:/mnt/c/Program '
 'Files/WireGuard/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program '
 'Files (x86)/dotnet/:/mnt/c/Program Files '
 '(x86)/ZeroTier/One/:/mnt/c/Users/TrevorSullivan/scoop/apps/vscodium/current/bin:/mnt/c/Users/TrevorSullivan/scoop/apps/qemu/current:/mnt/c/Users/TrevorSullivan/scoop/apps/flutter/current/bin/cache/dart-sdk/bin:/mnt/c/Users/TrevorSullivan/scoop/apps/nodejs/current/bin:/mnt/c/Users/TrevorSullivan/scoop/apps/nodejs/current:/mnt/c/Users/TrevorSullivan/scoop/apps/vscode/current/bin:/mnt/c/Users/TrevorSullivan/scoop/apps/temurin8-jdk/current/bin:/mnt/c/Users/TrevorSullivan/scoop/apps/python/current/Scripts:/mnt/c/Users/TrevorSullivan/scoop/apps/python/current:/mnt/c/Users/TrevorSullivan/go/bin:/mnt/c/Users/TrevorSullivan/scoop/apps/openssl/current/bin:/mnt/c/Users/TrevorSullivan/.krew/bin:/mnt/c/Users/TrevorSullivan/scoop/apps/pwsh/current:/mnt/c/Program '
 'Files/Docker/Docker/resources/bin:/mnt/c/ProgramData/DockerDesktop/version-bin:/mnt/c/Users/TrevorSullivan/scoop/apps/android-sdk/current/tools/bin:/mnt/c/Users/TrevorSullivan/scoop/apps/krew/current/.krew/bin:/mnt/c/Users/TrevorSullivan/scoop/apps/pycharm/current/bin:/mnt/c/Users/TrevorSullivan/scoop/shims:/mnt/c/Users/TrevorSullivan/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/TrevorSullivan/.dotnet/tools:/mnt/c/Program '
 'Files/NVIDIA Corporation/NVSMI:/mnt/c/Program '
 'Files/Multipass/bin:/mnt/c/Users/TrevorSullivan/scoop/apps/hyper/3.1.4/resources/bin:/mnt/c/Users/TrevorSullivan/scoop/apps/hyper/3.2.3/resources/bin:/mnt/c/Program '
 'Files/RedHat/Podman:/mnt/c/Users/TrevorSullivan/AppData/Local/Microsoft/WindowsApps:/snap/bin')
#     HOSTTYPE = 'x86_64'
#     PULSE_SERVER = '/mnt/wslg/PulseServer'
#     OLDPWD = '/home/trevor/.buildozer/android/platform/android-sdk'
#     _ = '/home/trevor/.local/bin/buildozer'
#     PACKAGES_PATH = '/home/trevor/.buildozer/android/packages'
#     ANDROIDSDK = '/home/trevor/.buildozer/android/platform/android-sdk'
#     ANDROIDNDK = '/home/trevor/.buildozer/android/platform/android-ndk-r23b'
#     ANDROIDAPI = '27'
#     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
pcgeek86 commented 2 years ago

Looks like this command should fix it:

sudo apt-get install autoconf libtool --yes
misl6 commented 2 years ago

Hi @pcgeek86 !

Yeah, autoconf is a build dependency. (See: https://python-for-android.readthedocs.io/en/latest/quickstart/#installing-dependencies)

BTW, the issue from @0xB00B looks slightly different.

@0xB00B did you had the chance to try the latest version of python-for-android?

frak0d commented 2 years ago

@misl6 umm... no, its been 2 years and i have given up on python. Also I am not going to download several gigabytes of android build tools.

misl6 commented 2 years ago

Closing as stale, but feel free to re-open if needed.

strubbi77 commented 1 year ago

Same as https://github.com/kivy/python-for-android/issues/2783