Closed bobwatcherx closed 11 months ago
I have a suggestion if you are using WSL 1, otherwise not.
I'm using Linux Mint. and is there any way to solve the error . is it from the ndk version
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 https://github.com/kivy/buildozer/issues/1543#issuecomment-1382574110 about patching Clang.
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
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/
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
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
ACLOCAL='${SHELL} '\''/home/pille/.local/share/python-for-android/build/other_builds/libffi/arm64-v8andk_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-v8andk_target_25/libffi/missing'\'' autoconf' AUTOHEADER='${SHELL} '\''/home/pille/.local/share/python-for-android/build/other_builds/libffi/arm64-v8andk_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-v8andk_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='' amEXEEXT_FALSE='' am__EXEEXT_TRUE='' amfastdepCCAS_FALSE='' amfastdepCCAS_TRUE='' am__fastdepCC_FALSE='' amfastdepCC_TRUE='' amfastdepCXX_FALSE='' am__fastdepCXX_TRUE='' aminclude='' amisrc='' amleading_dot='.' amnodep='' amquote='' amtar='$${TAR-tar} chof - "$$tardir"' amuntar='$${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 /
configure: exit 77 `
Did you try the suggestion above?
You might want to look at the issue referenced there, particularly this post https://github.com/kivy/buildozer/issues/1543#issuecomment-1382574110 about patching Clang.
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:
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
It appears from the logs above you use 25c and perhaps 25 as well, the Buildozer default is 25b.
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-v8andk_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-v8andk_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
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.
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.
👋 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.
i have proble for build apk using flask framework
my bashrc file
error log