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

Error Build APK FIle using Flask #2783

Closed
bobwatcherx opened this issue Apr 23, 2023 · 12 comments
Closed

Error Build APK FIle using Flask #2783

bobwatcherx opened this issue Apr 23, 2023 · 12 comments

Comments

@bobwatcherx
Copy link

i have proble for build apk using flask framework

my bashrc file

export ANDROID_HOME=/root/Android/Sdk
export ANDROID_NDK=/home/mino/Downloads/android-ndk-r25c

export PATH=$PATH:/root/Android/Sdk/tools
export PATH=$PATH:/root/Android/Sdk/platform-tools
export PATH=$PATH:/root/Android/Sdk/tools/bin/sdkmanager
export PATH=$PATH:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools:$ANDROID_NDK



export ANDROIDSDK=/root/Android/Sdk
export ANDROIDNDK="$ANDROID_NDK"
export ANDROIDAPI="29"  # Target API version of your application
export NDKAPI="25"  # Minimum supported API version of your application
export ANDROIDNDKVER="r25"  # Version of the NDK you installed

error log

root@mino-HP-Convertible-x360-11-ab1XX:/home/mino/belajar/flask-webview-android-p4a# p4a apk --private flaskapp/main.py --package=org.example.myapp --name "My WebView Application" --version 0.1 --bootstrap=webview --requirements=flask --port=5000 --arch=arm64-v8a 
[WARNING]: prerequisites.py is experimental and does not support all prerequisites yet.
[WARNING]: Please report any issues to the python-for-android issue tracker.
[WARNING]: $ANDROIDNDKVER is deprecated and no longer necessary, the value you set is ignored
[INFO]:    Will compile for the following archs: arm64-v8a
[INFO]:    Found Android API target in $ANDROIDAPI: 29
[WARNING]: Target API 29 < 30
[WARNING]: Target APIs lower than 30 are no longer supported on Google Play, and are not recommended. Note that the Target API can be higher than your device Android version, and should usually be as high as possible.
[INFO]:    Available Android APIs are (29, 33)
[INFO]:    Requested API target 29 is available, continuing.
[INFO]:    Found NDK dir in $ANDROIDNDK: /home/mino/Downloads/android-ndk-r25c
[INFO]:    Found NDK version 25c
[INFO]:    Found Android API target in $NDKAPI
/usr/bin/python3: No module named cython
[WARNING]: Cython for python3 missing. If you are building for  a python 3 target (which is the default) then THINGS WILL BREAK.
[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', 'sqlite3', 'python3', 'genericndkbuild', 'setuptools', 'flask', 'six', 'pyjnius', 'android']
[INFO]:    The selected bootstrap is webview
[INFO]:    # Creating dist with webview bootstrap
[INFO]:    Dist will have name unnamed_dist_1 and requirements (flask)
[INFO]:    Dist contains the following requirements as recipes: ['hostpython3', 'libffi', 'openssl', 'sqlite3', 'python3', 'genericndkbuild', 'setuptools', 'flask', 'six', 'pyjnius', 'android']
[INFO]:    Dist will also contain modules (werkzeug, jinja2, click, itsdangerous, markupsafe) installed from pip
[INFO]:    Dist will be build in mode debug
[INFO]:    -> directory context /root/.local/share/python-for-android/build/bootstrap_builds/webview
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Recipe build order is ['hostpython3', 'libffi', 'openssl', 'sqlite3', 'python3', 'genericndkbuild', 'setuptools', 'flask', 'six', 'pyjnius', 'android']
[INFO]:    The requirements (click, itsdangerous, jinja2, markupsafe, werkzeug) were not found as recipes, they will be installed with pip.
[INFO]:    # Downloading recipes 
[INFO]:    Downloading hostpython3
[INFO]:    -> running mkdir -p /root/.local/share/python-for-android/packages/hostpython3
[INFO]:    -> directory context /root/.local/share/python-for-android/packages/hostpython3
[INFO]:    -> running basename https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tgz
[INFO]:    hostpython3 download already cached, skipping                                                                 
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Downloading libffi
[INFO]:    -> running mkdir -p /root/.local/share/python-for-android/packages/libffi
[INFO]:    -> directory context /root/.local/share/python-for-android/packages/libffi
[INFO]:    -> running basename https://github.com/libffi/libffi/archive/v3.4.2.tar.gz
[INFO]:    libffi download already cached, skipping                                                                      
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Downloading openssl
[INFO]:    -> running mkdir -p /root/.local/share/python-for-android/packages/openssl
[INFO]:    -> directory context /root/.local/share/python-for-android/packages/openssl
[INFO]:    -> running basename https://www.openssl.org/source/openssl-1.1.1m.tar.gz
[INFO]:    openssl download already cached, skipping                                                                     
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Downloading sqlite3
[INFO]:    -> running mkdir -p /root/.local/share/python-for-android/packages/sqlite3
[INFO]:    -> directory context /root/.local/share/python-for-android/packages/sqlite3
[INFO]:    -> running basename https://www.sqlite.org/2021/sqlite-amalgamation-3350500.zip
[INFO]:    sqlite3 download already cached, skipping                                                                     
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Downloading python3
[INFO]:    -> running mkdir -p /root/.local/share/python-for-android/packages/python3
[INFO]:    -> directory context /root/.local/share/python-for-android/packages/python3
[INFO]:    -> running basename https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tgz
[INFO]:    python3 download already cached, skipping                                                                     
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Downloading genericndkbuild
[INFO]:    Skipping genericndkbuild download as no URL is set
[INFO]:    Downloading setuptools
[INFO]:    -> running mkdir -p /root/.local/share/python-for-android/packages/setuptools
[INFO]:    -> directory context /root/.local/share/python-for-android/packages/setuptools
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/setuptools/setuptools-51.3.3.tar.gz
[INFO]:    setuptools download already cached, skipping                                                                  
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Downloading flask
[INFO]:    -> running mkdir -p /root/.local/share/python-for-android/packages/flask
[INFO]:    -> directory context /root/.local/share/python-for-android/packages/flask
[INFO]:    -> running basename https://github.com/pallets/flask/archive/2.0.3.zip
[INFO]:    flask download already cached, skipping                                                                       
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Downloading six
[INFO]:    -> running mkdir -p /root/.local/share/python-for-android/packages/six
[INFO]:    -> directory context /root/.local/share/python-for-android/packages/six
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/six/six-1.15.0.tar.gz
[INFO]:    six download already cached, skipping                                                                         
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Downloading pyjnius
[INFO]:    -> running mkdir -p /root/.local/share/python-for-android/packages/pyjnius
[INFO]:    -> directory context /root/.local/share/python-for-android/packages/pyjnius
[INFO]:    -> running basename https://github.com/kivy/pyjnius/archive/1.4.2.zip
[INFO]:    pyjnius download already cached, skipping                                                                     
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Downloading android
[INFO]:    Skipping android download as no URL is set
[INFO]:    # Building all recipes for arch arm64-v8a
[INFO]:    # Unpacking recipes
[INFO]:    Unpacking hostpython3 for arm64-v8a
[INFO]:    -> running basename https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tgz
[INFO]:    -> directory context /root/.local/share/python-for-android/build/other_builds/hostpython3/desktop             
[INFO]:    hostpython3 is already unpacked, skipping
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Unpacking libffi for arm64-v8a
[INFO]:    -> running basename https://github.com/libffi/libffi/archive/v3.4.2.tar.gz
[INFO]:    -> directory context /root/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25 
[INFO]:    -> running mv libffi-3.4.2 /root/.local/share/python-for-android/build/other_builds...(and 39 more)
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Unpacking openssl for arm64-v8a
[INFO]:    -> running basename https://www.openssl.org/source/openssl-1.1.1m.tar.gz
[INFO]:    -> directory context /root/.local/share/python-for-android/build/other_builds/openssl/arm64-v8a__ndk_target_25
[INFO]:    -> running mv openssl-1.1.1m /root/.local/share/python-for-android/build/other_buil...(and 46 more)
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Unpacking sqlite3 for arm64-v8a
[INFO]:    -> running basename https://www.sqlite.org/2021/sqlite-amalgamation-3350500.zip
[INFO]:    -> directory context /root/.local/share/python-for-android/build/other_builds/sqlite3/arm64-v8a__ndk_target_25
[INFO]:    -> running mv sqlite-amalgamation-3350500 /root/.local/share/python-for-android/bui...(and 56 more)
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Unpacking python3 for arm64-v8a
[INFO]:    -> running basename https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tgz
[INFO]:    -> directory context /root/.local/share/python-for-android/build/other_builds/python3/arm64-v8a__ndk_target_25
[INFO]:    -> running mv Python-3.9.9 /root/.local/share/python-for-android/build/other_builds...(and 41 more)
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Unpacking genericndkbuild for arm64-v8a
[INFO]:    Skipping genericndkbuild unpack as no URL is set
[INFO]:    Unpacking setuptools for arm64-v8a
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/setuptools/setuptools-51.3.3.tar.gz
[INFO]:    -> directory context /root/.local/share/python-for-android/build/other_builds/setuptools/arm64-v8a__ndk_target_25
[INFO]:    -> running mv setuptools-51.3.3 /root/.local/share/python-for-android/build/other_b...(and 52 more)
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Unpacking flask for arm64-v8a
[INFO]:    -> running basename https://github.com/pallets/flask/archive/2.0.3.zip
[INFO]:    -> directory context /root/.local/share/python-for-android/build/other_builds/flask/arm64-v8a__ndk_target_25  
[INFO]:    -> running mv flask-2.0.3 /root/.local/share/python-for-android/build/other_builds/...(and 36 more)
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Unpacking six for arm64-v8a
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/six/six-1.15.0.tar.gz
[INFO]:    -> directory context /root/.local/share/python-for-android/build/other_builds/six/arm64-v8a__ndk_target_25    
[INFO]:    -> running mv six-1.15.0 /root/.local/share/python-for-android/build/other_builds/s...(and 31 more)
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    Unpacking pyjnius for arm64-v8a
[INFO]:    -> running basename https://github.com/kivy/pyjnius/archive/1.4.2.zip
[INFO]:    -> directory context /root/.local/share/python-for-android/build/other_builds/pyjnius-genericndkbuild/arm64-v8a__ndk_target_25
[INFO]:    -> running mv pyjnius-1.4.2 /root/.local/share/python-for-android/build/other_build...(and 58 more)
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    -> running rm -rf /root/.local/share/python-for-android/build/other_builds/android-...(and 48 more)
[INFO]:    -> running cp -a /usr/local/lib/python3.10/dist-packages/pythonforandroid/recipes/a...(and 124 more)
[INFO]:    # Prebuilding recipes
[INFO]:    Prebuilding hostpython3 for arm64-v8a
[INFO]:    hostpython3 has no prebuild_arm64_v8a, skipping
[INFO]:    Applying patches for hostpython3[arm64-v8a]
[INFO]:    hostpython3 already patched, skipping
[INFO]:    Prebuilding libffi for arm64-v8a
[INFO]:    libffi has no prebuild_arm64_v8a, skipping
[INFO]:    Applying patches for libffi[arm64-v8a]
[INFO]:    Applying patch remove-version-info.patch
[INFO]:    -> running patch -t -d /root/.local/share/python-for-android/build/other_builds/lib...(and 140 more)
[INFO]:    -> running touch /root/.local/share/python-for-android/build/other_builds/libffi/ar...(and 38 more)           
[INFO]:    Prebuilding openssl for arm64-v8a
[INFO]:    openssl has no prebuild_arm64_v8a, skipping
[INFO]:    Prebuilding sqlite3 for arm64-v8a
[INFO]:    sqlite3 has no prebuild_arm64_v8a, skipping
[INFO]:    Prebuilding python3 for arm64-v8a
[INFO]:    python3 has no prebuild_arm64_v8a, skipping
[INFO]:    Applying patches for python3[arm64-v8a]
[INFO]:    Applying patch patches/pyconfig_detection.patch
[INFO]:    -> running patch -t -d /root/.local/share/python-for-android/build/other_builds/pyt...(and 150 more)
[INFO]:    Applying patch patches/reproducible-buildinfo.diff                                                            
[INFO]:    -> running patch -t -d /root/.local/share/python-for-android/build/other_builds/pyt...(and 153 more)
[INFO]:    Applying patch patches/py3.8.1.patch                                                                          
[INFO]:    -> running patch -t -d /root/.local/share/python-for-android/build/other_builds/pyt...(and 139 more)
[INFO]:    -> running touch /root/.local/share/python-for-android/build/other_builds/python3/a...(and 40 more)           
[INFO]:    Prebuilding genericndkbuild for arm64-v8a
[INFO]:    genericndkbuild has no prebuild_arm64_v8a, skipping
[INFO]:    Prebuilding setuptools for arm64-v8a
[INFO]:    setuptools has no prebuild_arm64_v8a, skipping
[INFO]:    Prebuilding flask for arm64-v8a
[INFO]:    flask has no prebuild_arm64_v8a, skipping
[INFO]:    Prebuilding six for arm64-v8a
[INFO]:    six has no prebuild_arm64_v8a, skipping
[INFO]:    Prebuilding pyjnius for arm64-v8a
[INFO]:    pyjnius has no prebuild_arm64_v8a, skipping
[INFO]:    Applying patches for pyjnius[arm64-v8a]
[INFO]:    Applying patch genericndkbuild_jnienv_getter.patch
[INFO]:    -> running patch -t -d /root/.local/share/python-for-android/build/other_builds/pyj...(and 169 more)
[INFO]:    -> running touch /root/.local/share/python-for-android/build/other_builds/pyjnius-g...(and 56 more)           
[INFO]:    Prebuilding android for arm64-v8a
[INFO]:    android has no prebuild_arm64_v8a, skipping
[INFO]:    -> directory context /root/.local/share/python-for-android/build/other_builds/android-genericndkbuild/arm64-v8a__ndk_target_25/android
[INFO]:    <- directory context /home/mino/belajar/flask-webview-android-p4a
[INFO]:    # Building recipes
[INFO]:    Building hostpython3 for arm64-v8a
[INFO]:    hostpython3 said it is already built, skipping
[INFO]:    Building libffi for arm64-v8a
[INFO]:    -> directory context /root/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi
[INFO]:    -> running autogen.sh
[INFO]:    -> running autoreconf -vif                                                                                    
[INFO]:    -> running configure --host=aarch64-linux-android --prefix=/root/.local/share/pytho...(and 106 more)          
           working: See `config.log' for more details                                                                    Exception in thread background thread for pid 28337:
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 1641, in wrap
    fn(*rgs, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 2569, in background_thread
    handle_exit_code(exit_code)
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 2269, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 869, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_77: 

  RAN: /root/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi/configure --host=aarch64-linux-android --prefix=/root/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi --disable-builddir --enable-shared

  STDOUT:
checking build system type... x86_64-pc-linux-gnu
checking host system type... aarch64-unknown-linux-android
checking target system type... aarch64-unknown-linux-android
checking for gsed... sed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for aarch64-linux-android-strip... /home/mino/Downloads/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --strip-unneeded
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make -j2 sets $(MAKE)... yes
checking whether make -j2 supports nested variables... yes
checking for aarch64-linux-android-gcc... /usr/bin/ccache /home/mino/Downloads/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android25 -fomit-frame-pointer -march=armv8-a -fPIC
checking whether the C compiler works... no
configure: error: in `/root/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi':
configure: error: C compiler cannot create executables
See `config.log' for more details


  STDERR:

Traceback (most recent call last):                                                                                       
  File "/usr/local/bin/p4a", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/usr/local/lib/python3.10/dist-packages/pythonforandroid/toolchain.py", line 734, in __init__
    getattr(self, command)(args)
  File "/usr/local/lib/python3.10/dist-packages/pythonforandroid/toolchain.py", line 153, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/usr/local/lib/python3.10/dist-packages/pythonforandroid/toolchain.py", line 212, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx,
  File "/usr/local/lib/python3.10/dist-packages/pythonforandroid/build.py", line 504, in build_recipes
    recipe.build_arch(arch)
  File "/usr/local/lib/python3.10/dist-packages/pythonforandroid/recipes/libffi/__init__.py", line 30, in build_arch
    shprint(sh.Command('./configure'),
  File "/usr/local/lib/python3.10/dist-packages/pythonforandroid/logger.py", line 167, in shprint
    for line in output:
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 915, in next
    self.wait()
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 845, in wait
    self.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python3.10/dist-packages/sh.py", line 869, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_77: 

  RAN: /root/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi/configure --host=aarch64-linux-android --prefix=/root/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi --disable-builddir --enable-shared

  STDOUT:
checking build system type... x86_64-pc-linux-gnu
checking host system type... aarch64-unknown-linux-android
checking target system type... aarch64-unknown-linux-android
checking for gsed... sed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for aarch64-linux-android-strip... /home/mino/Downloads/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --strip-unneeded
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make -j2 sets $(MAKE)... yes
checking whether make -j2 supports nested variables... yes
checking for aarch64-linux-android-gcc... /usr/bin/ccache /home/mino/Downloads/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android25 -fomit-frame-pointer -march=armv8-a -fPIC
checking whether the C compiler works... no
configure: error: in `/root/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi':
configure: error: C compiler cannot create executables
See `config.log' for more details


  STDERR:
@RobertFlatt
Copy link
Contributor

I have a suggestion if you are using WSL 1, otherwise not.

@bobwatcherx
Copy link
Author

I'm using Linux Mint. and is there any way to solve the error . is it from the ndk version

@RobertFlatt
Copy link
Contributor

RobertFlatt commented Apr 27, 2023

Sorry I don't know anything about Mint, or building for Flask. But.....

The is the WSL issue https://github.com/Android-for-Python/Android-for-Python-Users#c-compiler-cannot-create-executables

You might want to look at the issue referenced there, particularly this post kivy/buildozer#1543 (comment) about patching Clang.

@strubbi77
Copy link
Contributor

Have a simular issue on debian 12.0
Tried newest p4a. Python 3.10 and 3.11. Changing recipe version of libffi to 3.4.4.
Added +x to the complete ndk directory.

Every time the build stopped with
configure: error: in /home/pille/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi': configure: error: C compiler cannot create executables See config.log' for more details

`This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by libffi configure 3.4.2, which was
generated by GNU Autoconf 2.71. Invocation command line was

$ /home/pille/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi/configure --host=aarch64-linux-android --prefix=/home/pille/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi --disable-builddir --enable-shared

---------

Platform.

---------

hostname = kreuz8-lap2023
uname -m = x86_64
uname -r = 6.1.0-7-amd64
uname -s = Linux
uname -v = #1 SMP PREEMPT_DYNAMIC Debian 6.1.20-2 (2023-04-08)

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = x86_64
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/
PATH: /home/pille/src/android-ndk-r25c/
PATH: /home/pille/src/android-sdk/tools/
PATH: /home/pille/src/python3.10-kivy/bin/
PATH: /usr/local/bin/
PATH: /usr/bin/
PATH: /bin/
PATH: /usr/local/games/
PATH: /usr/games/
PATH: /home/pille/src/android-sdk/cmdline-tools/latest/bin/

-----------

Core tests.

-----------

configure:3072: looking for aux files: ltmain.sh compile missing install-sh config.guess config.sub
configure:3085: trying ./
configure:3114: ./ltmain.sh found
configure:3114: ./compile found
configure:3114: ./missing found
configure:3096: ./install-sh found
configure:3114: ./config.guess found
configure:3114: ./config.sub found
configure:3235: checking build system type
configure:3250: result: x86_64-pc-linux-gnu
configure:3270: checking host system type
configure:3284: result: aarch64-unknown-linux-android
configure:3304: checking target system type
configure:3318: result: aarch64-unknown-linux-android
configure:3417: checking for gsed
configure:3453: result: sed
configure:3482: checking for a BSD-compatible install
configure:3555: result: /usr/bin/install -c
configure:3566: checking whether build environment is sane
configure:3621: result: yes
configure:3673: checking for aarch64-linux-android-strip
configure:3705: result: /home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --strip-unneeded
configure:3776: checking for a race-free mkdir -p
configure:3820: result: /usr/bin/mkdir -p
configure:3827: checking for gawk
configure:3848: found /usr/bin/gawk
configure:3859: result: gawk
configure:3870: checking whether make -j12 sets $(MAKE)
configure:3893: result: yes
configure:3923: checking whether make -j12 supports nested variables
configure:3941: result: yes
configure:4105: checking for aarch64-linux-android-gcc
configure:4137: result: /usr/bin/ccache /home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android25 -fomit-frame-pointer -march=armv8-a -fPIC
configure:4535: checking for C compiler version
configure:4544: /usr/bin/ccache /home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android25 -fomit-frame-pointer -march=armv8-a -fPIC --version >&5
Android (9352603, based on r450784d1) clang version 14.0.7 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0cca074e9238af8b4106c30add4418f6)
Target: aarch64-unknown-linux-android25
Thread model: posix
InstalledDir: /home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin
configure:4555: $? = 0
configure:4544: /usr/bin/ccache /home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android25 -fomit-frame-pointer -march=armv8-a -fPIC -v >&5
Android (9352603, based on r450784d1) clang version 14.0.7 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0cca074e9238af8b4106c30add4418f6)
Target: aarch64-unknown-linux-android25
Thread model: posix
InstalledDir: /home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin
clang-14: warning: argument unused during compilation: '-fomit-frame-pointer' [-Wunused-command-line-argument]
clang-14: warning: argument unused during compilation: '-fPIC' [-Wunused-command-line-argument]
configure:4555: $? = 0
configure:4544: /usr/bin/ccache /home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android25 -fomit-frame-pointer -march=armv8-a -fPIC -V >&5
clang-14: error: argument to '-V' is missing (expected 1 value)
clang-14: error: no input files
configure:4555: $? = 1
configure:4544: /usr/bin/ccache /home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android25 -fomit-frame-pointer -march=armv8-a -fPIC -qversion >&5
clang-14: error: unknown argument '-qversion'; did you mean '--version'?
clang-14: error: no input files
configure:4555: $? = 1
configure:4544: /usr/bin/ccache /home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android25 -fomit-frame-pointer -march=armv8-a -fPIC -version >&5
clang-14: error: unknown argument '-version'; did you mean '--version'?
clang-14: error: no input files
configure:4555: $? = 1
configure:4575: checking whether the C compiler works
configure:4597: /usr/bin/ccache /home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android25 -fomit-frame-pointer -march=armv8-a -fPIC -target aarch64-linux-android25 -fomit-frame-pointer -march=armv8-a -fPIC -DANDROID -I/home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/pille/.local/share/python-for-android/build/python-installs/MVO_Bed_App/arm64-v8a/include/python3.9 -L/home/pille/.local/share/python-for-android/build/libs_collections/MVO_Bed_App/arm64-v8a conftest.c >&5
ld: error: cannot open crtbegin_dynamic.o: No such file or directory
ld: error: cannot open crtend_android.o: No such file or directory
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
configure:4601: $? = 1
configure:4641: result: no
configure: failed program was:
| /* confdefs.h /
| #define PACKAGE_NAME "libffi"
| #define PACKAGE_TARNAME "libffi"
| #define PACKAGE_VERSION "3.4.2"
| #define PACKAGE_STRING "libffi 3.4.2"
| #define PACKAGE_BUGREPORT "http://github.com/libffi/libffi/issues"
| #define PACKAGE_URL ""
| #define PACKAGE "libffi"
| #define VERSION "3.4.2"
| /
end confdefs.h. */
|
| int
| main (void)
| {
|
| ;
| return 0;
| }
configure:4646: error: in /home/pille/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi': configure:4648: error: C compiler cannot create executables See config.log' for more details

----------------

Cache variables.

----------------

ac_cv_build=x86_64-pc-linux-gnu
ac_cv_env_CCASFLAGS_set=
ac_cv_env_CCASFLAGS_value=
ac_cv_env_CCAS_set=
ac_cv_env_CCAS_value=
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value='-DANDROID -I/home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/pille/.local/share/python-for-android/build/python-installs/MVO_Bed_App/arm64-v8a/include/python3.9'
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_LT_SYS_LIBRARY_PATH_set=
ac_cv_env_LT_SYS_LIBRARY_PATH_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=aarch64-linux-android
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=aarch64-unknown-linux-android
ac_cv_path_ax_enable_builddir_sed=sed
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_mkdir=/usr/bin/mkdir
ac_cv_prog_AWK=gawk
ac_cv_prog_CC='/usr/bin/ccache /home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android25 -fomit-frame-pointer -march=armv8-a -fPIC'
ac_cv_prog_STRIP='/home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --strip-unneeded'
ac_cv_prog_make_make_set=yes
ac_cv_target=aarch64-unknown-linux-android
am_cv_make_support_nested_variables=yes

-----------------

Output variables.

-----------------

ACLOCAL='${SHELL} '''/home/pille/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi/missing''' aclocal-1.16'
ALLOCA=''
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AM_BACKSLASH=''
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
AM_DEFAULT_VERBOSITY='1'
AM_LTLDFLAGS=''
AM_RUNTESTFLAGS=''
AM_V='$(V)'
AR='/home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar'
AUTOCONF='${SHELL} '''/home/pille/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi/missing''' autoconf'
AUTOHEADER='${SHELL} '''/home/pille/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi/missing''' autoheader'
AUTOMAKE='${SHELL} '''/home/pille/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi/missing''' automake-1.16'
AWK='gawk'
BUILD_DOCS_FALSE=''
BUILD_DOCS_TRUE=''
CC='/usr/bin/ccache /home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android25 -fomit-frame-pointer -march=armv8-a -fPIC'
CCAS=''
CCASDEPMODE=''
CCASFLAGS=''
CCDEPMODE=''
CFLAGS='-target aarch64-linux-android25 -fomit-frame-pointer -march=armv8-a -fPIC'
CPPFLAGS='-DANDROID -I/home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/pille/.local/share/python-for-android/build/python-installs/MVO_Bed_App/arm64-v8a/include/python3.9'
CSCOPE='cscope'
CTAGS='ctags'
CXX='/usr/bin/ccache /home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -target aarch64-linux-android25 -fomit-frame-pointer -march=armv8-a -fPIC'
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS='-target aarch64-linux-android25 -fomit-frame-pointer -march=armv8-a -fPIC'
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
DLLTOOL=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
ETAGS='etags'
EXEEXT=''
FFI_DEBUG_FALSE=''
FFI_DEBUG_TRUE=''
FFI_EXEC_TRAMPOLINE_TABLE=''
FFI_EXEC_TRAMPOLINE_TABLE_FALSE=''
FFI_EXEC_TRAMPOLINE_TABLE_TRUE=''
FGREP=''
FILECMD=''
GREP=''
HAVE_LONG_DOUBLE=''
HAVE_LONG_DOUBLE_VARIANT=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LD=''
LDFLAGS=' -L/home/pille/.local/share/python-for-android/build/libs_collections/MVO_Bed_App/arm64-v8a'
LIBFFI_BUILD_VERSIONED_SHLIB_FALSE=''
LIBFFI_BUILD_VERSIONED_SHLIB_GNU_FALSE=''
LIBFFI_BUILD_VERSIONED_SHLIB_GNU_TRUE=''
LIBFFI_BUILD_VERSIONED_SHLIB_SUN_FALSE=''
LIBFFI_BUILD_VERSIONED_SHLIB_SUN_TRUE=''
LIBFFI_BUILD_VERSIONED_SHLIB_TRUE=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIPO=''
LN_S=''
LTLIBOBJS=''
LT_SYS_LIBRARY_PATH=''
MAINT=''
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE=''
MAKEINFO='${SHELL} '''/home/pille/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi/missing''' makeinfo'
MANIFEST_TOOL=''
MKDIR_P='/usr/bin/mkdir -p'
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OPT_LDFLAGS=''
OTOOL64=''
OTOOL=''
PACKAGE='libffi'
PACKAGE_BUGREPORT='http://github.com/libffi/libffi/issues'
PACKAGE_NAME='libffi'
PACKAGE_STRING='libffi 3.4.2'
PACKAGE_TARNAME='libffi'
PACKAGE_URL=''
PACKAGE_VERSION='3.4.2'
PATH_SEPARATOR=':'
PRTDIAG=''
RANLIB='/home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib'
READELF='/home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-readelf'
SECTION_LDFLAGS=''
SED=''
SET_MAKE=''
SHELL='/bin/bash'
STRIP='/home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --strip-unneeded'
TARGET='aarch64-unknown-linux-android'
TARGETDIR=''
TARGET_OBJ=''
TESTSUBDIR_FALSE=''
TESTSUBDIR_TRUE=''
VERSION='3.4.2'
ac_ct_AR=''
ac_ct_CC=''
ac_ct_CXX=''
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCCAS_FALSE=''
am__fastdepCCAS_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include=''
am__isrc=''
am__leading_dot='.'
am__nodep=''
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
ax_enable_builddir_sed='sed'
bindir='${exec_prefix}/bin'
build='x86_64-pc-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='pc'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='aarch64-unknown-linux-android'
host_alias='aarch64-linux-android'
host_cpu='aarch64'
host_os='linux-android'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /home/pille/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(MKDIR_P)'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/home/pille/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi'
program_transform_name='s,x,x,'
psdir='${docdir}'
runstatedir='${localstatedir}/run'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sys_symbol_underscore=''
sysconfdir='${prefix}/etc'
target='aarch64-unknown-linux-android'
target_alias='aarch64-linux-android'
target_cpu='aarch64'
target_os='linux-android'
target_vendor='unknown'
toolexecdir=''
toolexeclibdir=''

-----------

confdefs.h.

-----------

/* confdefs.h */
#define PACKAGE_NAME "libffi"
#define PACKAGE_TARNAME "libffi"
#define PACKAGE_VERSION "3.4.2"
#define PACKAGE_STRING "libffi 3.4.2"
#define PACKAGE_BUGREPORT "http://github.com/libffi/libffi/issues"
#define PACKAGE_URL ""
#define PACKAGE "libffi"
#define VERSION "3.4.2"

configure: exit 77
`

@RobertFlatt
Copy link
Contributor

Did you try the suggestion above?

You might want to look at the issue referenced there, particularly this post kivy/buildozer#1543 (comment) about patching Clang.

@strubbi77
Copy link
Contributor

Tried patchelf ... did not work

pille@kreuz8-lap2023:~/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin$ ldd clang-14
linux-vdso.so.1 (0x00007ffe6d5e8000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f566d581000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f566d57c000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f566d577000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f566d498000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f566d479000)
libc++.so.1 => /home/pille/src/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/./../lib64/libc++.so.1 (0x00007f566d35c000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f566d33c000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f566d15b000)
/lib64/ld-linux-x86-64.so.2 (0x00007f566d5a5000)

checking whether the C compiler works... no
configure: error: in /home/pille/.local/share/python-for-android/build/other_builds/libffi/arm64-v8a__ndk_target_25/libffi:
configure: error: C compiler cannot create executables
See config.log for more details

STDERR:

@strubbi77
Copy link
Contributor

Think I now know what the error is.

For me a changing of export NDKAP="25" to an other value helped.
With API=25 the check process of libffi tries to find arm-lnux-androideabi/25/crtend_so.o but there is no version 25. So it should be NDKAPI != 25

@RobertFlatt
Copy link
Contributor

It appears from the logs above you use 25c and perhaps 25 as well, the Buildozer default is 25b.

@strubbi77
Copy link
Contributor

Had to download 25b with
cmdline-tools/latest/bin/sdkmanager "ndk;25.1.8937393"

But still don't get to an end:
/usr/bin/ccache /home/pille/src/android-sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android30 -fomit-frame-pointer -march=armv8-a -fPIC -shared -L/home/pille/.local/share/python-for-android/build/libs_collections/MVO_Bed_App/arm64-v8a -L/home/pille/.local/share/python-for-android/build/other_builds/python3/arm64-v8a__ndk_target_30/python3/android-build -lpython3.9 -L/home/pille/.local/share/python-for-android/build/libs_collections/MVO_Bed_App/arm64-v8a -L/home/pille/.local/share/python-for-android/build/libs_collections/MVO_Bed_App -L/home/pille/.local/share/python-for-android/build/bootstrap_builds/sdl2/obj/local/arm64-v8a -target aarch64-linux-android30 -fomit-frame-pointer -march=armv8-a -fPIC -I/home/pille/.local/share/python-for-android/build/other_builds/python3/arm64-v8a__ndk_target_30/python3/Include -DANDROID -I/home/pille/src/android-sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/pille/.local/share/python-for-android/build/python-installs/MVO_Bed_App/arm64-v8a/include/python3.9 build/temp.linux-x86_64-3.9/home/pille/.local/share/python-for-android/build/other_builds/kivy/arm64-v8a__ndk_target_30/kivy/kivy/graphics/svg.o -o build/lib.linux-x86_64-3.9/kivy/graphics/svg.cpython-39-x86_64-linux-gnu.so -lm
error: command '/usr/bin/ccache' failed with exit code 1

@RobertFlatt
Copy link
Contributor

Buildozer downloads the NDL version specified in buildozer.spec
NDK 25b is the default for Buildozer.
I got no idea why you had to download by hand.

You might try clearing ccache.
Everything seems to point to corrupted build environment(s).

Oh, wait I just realized you are not using Buildozer.
I know that I don't know how to use p4a stand alone. Sorry.

@strubbi77
Copy link
Contributor

Got it to work again on my new machine.
python 3.11.2
python-for-android 2023.02.10

additional change was that I removed the --requirements line in the .p4a configuration file. Using ndk 25b or 25c makes no difference. Both versions work.

Copy link

👋 We use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please use our support channels to get help with the project.

If you're having trouble installing or using python-for-android, maybe you could be interested in our quickstart guide.

Let us know if this comment was made in error, and we'll be happy to reopen the issue.

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

5 participants