Closed zurgeg closed 3 years ago
Did you do a full clean after installing libffi? https://python-for-android.readthedocs.io/en/latest/troubleshooting/#modulenotfounderror-no-module-named-ctypes
I’m running a full clean/build now, it might take a while because Linux is running of a flash drive.
I added libffi and deleted .buildozer and tried building again, I got C compiler cannot create executables
while building libffi, trying reinstalling cython...
Nope, still get it...
Upon looking through the logs, it appears to be something involving buildozer trying to activate -V
on android clang, I'm assuming the were looking for a verbose option (probably -v
). If this is the case, can someone please fix this?
Here's how I know that this is the problem (lines from config.log):
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
In case it helps, this is config.log:
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.3-rc0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ /home/jonathan/Documents/COVID19App/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/configure --host=arm-linux-androideabi --prefix=/home/jonathan/Documents/COVID19App/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi --disable-builddir --enable-shared
## --------- ##
## Platform. ##
## --------- ##
hostname = jonathan-desktop
uname -m = x86_64
uname -r = 5.0.0-32-generic
uname -s = Linux
uname -v = #34~18.04.2-Ubuntu SMP Thu Oct 10 10:36:02 UTC 2019
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = unknown
/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/jonathan/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin
PATH: /home/jonathan/.buildozer/android/platform/android-ndk-r19b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86/bin/
PATH: /home/jonathan/.buildozer/android/platform/android-ndk-r19b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/
PATH: /home/jonathan/.buildozer/android/platform/android-ndk-r19b
PATH: /home/jonathan/.buildozer/android/platform/android-sdk/tools
PATH: /home/jonathan/.buildozer/android/platform/apache-ant-1.9.4/bin
PATH: /home/jonathan/.local/bin
PATH: /home/jonathan/bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
PATH: /usr/local/games
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2704: checking build system type
configure:2718: result: x86_64-pc-linux-gnu
configure:2738: checking host system type
configure:2751: result: arm-unknown-linux-androideabi
configure:2771: checking target system type
configure:2784: result: arm-unknown-linux-androideabi
configure:2881: checking for gsed
configure:2912: result: sed
configure:2940: checking for a BSD-compatible install
configure:3008: result: /usr/bin/install -c
configure:3019: checking whether build environment is sane
configure:3074: result: yes
configure:3130: checking for arm-linux-androideabi-strip
configure:3157: result: arm-linux-androideabi-strip --strip-unneeded
configure:3222: checking for a thread-safe mkdir -p
configure:3261: result: /bin/mkdir -p
configure:3268: checking for gawk
configure:3284: found /usr/bin/gawk
configure:3295: result: gawk
configure:3306: checking whether make -j6 sets $(MAKE)
configure:3328: result: yes
configure:3357: checking whether make -j6 supports nested variables
configure:3374: result: yes
configure:3519: checking for arm-linux-androideabi-gcc
configure:3546: result: /home/jonathan/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC
configure:3815: checking for C compiler version
configure:3824: /home/jonathan/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC --version >&5
Android (5058415 based on r339409) clang version 8.0.2 (https://android.googlesource.com/toolchain/clang 40173bab62ec746213857d083c0e8b0abb568790) (https://android.googlesource.com/toolchain/llvm 7a6618d69e7e8111e1d49dc9e7813767c5ca756a) (based on LLVM 8.0.2svn)
Target: armv7a-unknown-linux-android21
Thread model: posix
InstalledDir: /home/jonathan/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin
configure:3835: $? = 0
configure:3824: /home/jonathan/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -v >&5
Android (5058415 based on r339409) clang version 8.0.2 (https://android.googlesource.com/toolchain/clang 40173bab62ec746213857d083c0e8b0abb568790) (https://android.googlesource.com/toolchain/llvm 7a6618d69e7e8111e1d49dc9e7813767c5ca756a) (based on LLVM 8.0.2svn)
Target: armv7a-unknown-linux-android21
Thread model: posix
InstalledDir: /home/jonathan/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin
Found candidate GCC installation: /home/jonathan/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x
Selected GCC installation: /home/jonathan/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x
Candidate multilib: thumb;@mthumb
Candidate multilib: armv7-a;@march=armv7-a
Candidate multilib: armv7-a/thumb;@march=armv7-a@mthumb
Candidate multilib: .;
... rest of stderr output deleted ...
configure:3835: $? = 0
configure:3824: /home/jonathan/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:3835: $? = 1
configure:3824: /home/jonathan/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -qversion >&5
clang: error: unknown argument '-qversion', did you mean '--version'?
clang: error: no input files
configure:3835: $? = 1
configure:3855: checking whether the C compiler works
configure:3877: /home/jonathan/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -DANDROID -D__ANDROID_API__=21 -I/home/jonathan/.buildozer/android/platform/android-ndk-r19b/sysroot/usr/include/arm-linux-androideabi -I/home/jonathan/Documents/COVID19App/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/coronaviruscp/include/python3.8 -L/home/jonathan/Documents/COVID19App/.buildozer/android/platform/build-armeabi-v7a/build/libs_collections/coronaviruscp/armeabi-v7a conftest.c >&5
clang: error: unable to execute command: posix_spawn failed: Exec format error
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3881: $? = 1
configure:3919: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "libffi"
| #define PACKAGE_TARNAME "libffi"
| #define PACKAGE_VERSION "3.3-rc0"
| #define PACKAGE_STRING "libffi 3.3-rc0"
| #define PACKAGE_BUGREPORT "http://github.com/libffi/libffi/issues"
| #define PACKAGE_URL ""
| #define PACKAGE "libffi"
| #define VERSION "3.3-rc0"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3924: error: in `/home/jonathan/Documents/COVID19App/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi':
configure:3926: 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 -D__ANDROID_API__=21 -I/home/jonathan/.buildozer/android/platform/android-ndk-r19b/sysroot/usr/include/arm-linux-androideabi -I/home/jonathan/Documents/COVID19App/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/coronaviruscp/include/python3.8'
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
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=arm-linux-androideabi
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=arm-unknown-linux-androideabi
ac_cv_path_ax_enable_builddir_sed=sed
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_mkdir=/bin/mkdir
ac_cv_prog_AWK=gawk
ac_cv_prog_CC='/home/jonathan/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC'
ac_cv_prog_STRIP='arm-linux-androideabi-strip --strip-unneeded'
ac_cv_prog_make_make_set=yes
ac_cv_target=arm-unknown-linux-androideabi
am_cv_make_support_nested_variables=yes
## ----------------- ##
## Output variables. ##
## ----------------- ##
ACLOCAL='${SHELL} /home/jonathan/Documents/COVID19App/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/missing aclocal-1.15'
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='arm-linux-androideabi-ar'
AUTOCONF='${SHELL} /home/jonathan/Documents/COVID19App/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/missing autoconf'
AUTOHEADER='${SHELL} /home/jonathan/Documents/COVID19App/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/missing autoheader'
AUTOMAKE='${SHELL} /home/jonathan/Documents/COVID19App/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/missing automake-1.15'
AWK='gawk'
BUILD_DOCS_FALSE=''
BUILD_DOCS_TRUE=''
CC='/home/jonathan/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC'
CCAS=''
CCASDEPMODE=''
CCASFLAGS=''
CCDEPMODE=''
CFLAGS='-target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC'
CPP=''
CPPFLAGS='-DANDROID -D__ANDROID_API__=21 -I/home/jonathan/.buildozer/android/platform/android-ndk-r19b/sysroot/usr/include/arm-linux-androideabi -I/home/jonathan/Documents/COVID19App/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/coronaviruscp/include/python3.8'
CXX='/home/jonathan/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC'
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS='-target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC'
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
DLLTOOL=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
FFI_DEBUG_FALSE=''
FFI_DEBUG_TRUE=''
FFI_EXEC_TRAMPOLINE_TABLE=''
FFI_EXEC_TRAMPOLINE_TABLE_FALSE=''
FFI_EXEC_TRAMPOLINE_TABLE_TRUE=''
FGREP=''
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='arm-linux-androideabi-ld'
LDFLAGS=' -L/home/jonathan/Documents/COVID19App/.buildozer/android/platform/build-armeabi-v7a/build/libs_collections/coronaviruscp/armeabi-v7a'
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/jonathan/Documents/COVID19App/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/missing makeinfo'
MANIFEST_TOOL=''
MKDIR_P='/bin/mkdir -p'
NM='arm-linux-androideabi-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.3-rc0'
PACKAGE_TARNAME='libffi'
PACKAGE_URL=''
PACKAGE_VERSION='3.3-rc0'
PATH_SEPARATOR=':'
PRTDIAG=''
RANLIB='arm-linux-androideabi-ranlib'
SECTION_LDFLAGS=''
SED=''
SET_MAKE=''
SHELL='/bin/bash'
STRIP='arm-linux-androideabi-strip --strip-unneeded'
TARGET='arm-unknown-linux-androideabi'
TARGETDIR=''
TARGET_OBJ=''
TESTSUBDIR_FALSE=''
TESTSUBDIR_TRUE=''
VERSION='3.3-rc0'
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='arm-unknown-linux-androideabi'
host_alias='arm-linux-androideabi'
host_cpu='arm'
host_os='linux-androideabi'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /home/jonathan/Documents/COVID19App/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/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/jonathan/Documents/COVID19App/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/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='arm-unknown-linux-androideabi'
target_alias='arm-linux-androideabi'
target_cpu='arm'
target_os='linux-androideabi'
target_vendor='unknown'
toolexecdir=''
toolexeclibdir=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME "libffi"
#define PACKAGE_TARNAME "libffi"
#define PACKAGE_VERSION "3.3-rc0"
#define PACKAGE_STRING "libffi 3.3-rc0"
#define PACKAGE_BUGREPORT "http://github.com/libffi/libffi/issues"
#define PACKAGE_URL ""
#define PACKAGE "libffi"
#define VERSION "3.3-rc0"
configure: exit 77
Note: I think that they were looking for a --version option not --qversion as I don't know of any C/C++ compiler that uses --qversion...
Yes the config.log is definitely the file to look into.
The specific error your are pointing clang: error: argument to '-V' is missing (expected 1 value)
is actually not the reason for this to fail I think. I think it's actually part of the checking for C compiler version
checks.
However the one you get just after is not normal:
configure:3855: checking whether the C compiler works
configure:3877: /home/jonathan/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -target armv7a-linux-androideabi21 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -DANDROID -D__ANDROID_API__=21 -I/home/jonathan/.buildozer/android/platform/android-ndk-r19b/sysroot/usr/include/arm-linux-androideabi -I/home/jonathan/Documents/COVID19App/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/coronaviruscp/include/python3.8 -L/home/jonathan/Documents/COVID19App/.buildozer/android/platform/build-armeabi-v7a/build/libs_collections/coronaviruscp/armeabi-v7a conftest.c >&5
clang: error: unable to execute command: posix_spawn failed: Exec format error
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is where we need to continue digging. I think you're almost there :muscle:
Could you share the output of these commands:
file ~/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
sha1sum ~/.buildozer/android/platform/android-ndk-r19b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
I think it’s a problem with the linker, but I have it installed.
I assumed it didn't use the system linker, but if it does then yes check for that shebang thing. Basically check if your linker is a shell script or a binary
Oh wait, you're building from a 32 bits host, are you? Then that could simply be it. Edit: seems like you're not checking the "uname -m" output
How to I check this? I have no clue. If it helps, I have a AMD FX 6300
I think it's 64 as it's what we get from the logs:
hostname = jonathan-desktop
uname -m = x86_64
uname -r = 5.0.0-32-generic
uname -s = Linux
uname -v = #34~18.04.2-Ubuntu SMP Thu Oct 10 10:36:02 UTC 2019
Could you share me the output of the file and sha1sum command I shared above? The idea is to see if your clang binary didn't get unpacked properly. I think it's not very likely, but that and ld are the only thing I can think of now. Also if you're on Discord to follow up it would be easier to try things out
EDIT: I'm on Discord and am about to join the server...
Okay, just joined the Discord. EDIT: I'm @JG in the Kivy server. Also, I prefer github issues.
do you have an update on this issue? it would be really helpful if i could build an apk today/tommorow
OK the file
and sha1sum
command result don't look off.
Cool that you joined Discord, I think it could help if we debug the issue live there because we may need to play with different things as it's not really to me what happens.
I need to finish a couple of things before I dig further into this bug.
Until then if you're in a hurry to have it working you can always try on an Ubuntu container or VM
I'm gonna try a build on Google Colab/Cloud Shell, maybe that it has something to do with low disk space (as I said before, I'm running off a flash disk that has 32GB and only 10 for Linux)
Okay, it failed with
[INFO]: The requirements (certifi, scikit-learn) don't have recipes, attempting to install them with pip
[INFO]: If this fails, it may mean that the module has compiled components and needs a recipe.
[INFO]: -> directory context /content/.buildozer/android/platform/build-armeabi-v7a/build
[INFO]: -> running virtualenv --python=python3 ...(and 56 more)
Exception in thread background thread for pid 82832:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.6/dist-packages/sh.py", line 1540, in wrap
fn(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/sh.py", line 2459, in background_thread
handle_exit_code(exit_code)
File "/usr/local/lib/python3.6/dist-packages/sh.py", line 2157, in fn
return self.command.handle_command_exit_code(exit_code)
File "/usr/local/lib/python3.6/dist-packages/sh.py", line 815, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /usr/local/bin/virtualenv --python=python3 venv
STDOUT:
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 5, in <module>
from virtualenv.__main__ import run_with_catch
ModuleNotFoundError: No module named 'virtualenv.__main__'; 'virtualenv' is not a package
STDERR:
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/content/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1199, in <module>
main()
File "/content/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
ToolchainCL()
File "/content/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 671, in __init__
getattr(self, args.subparser_name.replace('-', '_'))(args)
File "/content/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 155, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/content/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 209, in build_dist_from_args
args, "ignore_setup_py", False
File "/content/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 605, in build_recipes
ignore_setup_py=ignore_project_setup_py
File "/content/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 782, in run_pymodules_install
'venv'
File "/content/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 180, in shprint
for line in output:
File "/usr/local/lib/python3.6/dist-packages/sh.py", line 863, in next
self.wait()
File "/usr/local/lib/python3.6/dist-packages/sh.py", line 792, in wait
self.handle_command_exit_code(exit_code)
File "/usr/local/lib/python3.6/dist-packages/sh.py", line 815, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /usr/local/bin/virtualenv --python=python3 venv
STDOUT:
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 5, in <module>
from virtualenv.__main__ import run_with_catch
ModuleNotFoundError: No module named 'virtualenv.__main__'; 'virtualenv' is not a package
Does Buildozer make any modifications to virtualenv because? It works before I run buildozer and doesn't after. EDIT: Moved this to the Discord in #support2
My progress on solving this has went backwards... Upon attempting uninstalling pip install
ed virtualenv and apt-get install
ing python3-virtualenv I come back to No module named _ctypes
.
Oh, just buildozer android clean
ed and it works.
Nope, apt-get installing venv doesn't work.
Hold on, just found a fix. It has to do with Juypter notebooks because thats what Google Colab uses. PRing a fix...
EDIT: Nevermind, couldn't seem to find the part I was looking for. What is was trying to say is the bare /usr/local/bin/virtualenv blablabla...
causes an error. It seems that if I run python -m virtualenv
it works. If anyone can find where it calls virtualenv that would help me make a fix.
Just PRed a fix, kivy/python-for-android#2145.
I had the same problem. At the end i installed libffi6, libffi-dev and Python-for-Android. It did the work and now i'm with next problem...
@fma91 For some reason it doesn't work on a lot of machines (from my experience). My suggestion is to create a notebook here and use commands by typing !
before them. So to achieve this you would do
!pip install buildozer
!sudo apt-get install java-8-openjdk
!sudo update-alternatives java
# Press 2 and hit enter
!buildozer android debug
I can't seem to get it to work on Google Colab either, I have the same spec file and error log as you did. I know this issue is about 3 months old but I really am so annoyed than Google Colab can download everything in 5 mins and fails on one small bit.
Using just straight p4a
I got it to work @rayzchen.
I had installed libffi-dev
but still showing, this is because the windows_support.py
is unable to locate _ctypes
module due to missing path dir in sys.path
.
First install libffi-dev using sudo apt install libffi-dev
.
It will install 2 modules in these dirs
_ctypes
in /usr/lib/python3.6/lib-dynload/
ctypes
in /usr/lib/python3.6/
Since only _ctypes
is missing lets add that.
Edit ./.buildozer/android/platform/build-armeabi-v7a/build/other_builds/setuptools/armeabi-v7a__ndk_target_21/setuptools/setuptools/windows_support.py
which is under your project folder. (not ~/.buildozer
) .
Add these lines at very beginning
import sys
sys.path.append('/usr/lib/python3.6/lib-dynload')
save & enter your buildozer command again
I know this is poor work around and I am not expert in python either
Using just straight
p4a
I got it to work @rayzchen.
How do you do that? Sorry for the late reply.
I don't remember, will check my notebooks later. It was something along the lines of running a build with p4a, the docs will help you there.
I had installed
libffi-dev
but still showing, this is because thewindows_support.py
is unable to locate_ctypes
module due to missing path dir insys.path
.First install libffi-dev using
sudo apt install libffi-dev
. It will install 2 modules in these dirs* `_ctypes` in `/usr/lib/python3.6/lib-dynload/` * `ctypes` in `/usr/lib/python3.6/`
Since only
_ctypes
is missing lets add that. Edit./.buildozer/android/platform/build-armeabi-v7a/build/other_builds/setuptools/armeabi-v7a__ndk_target_21/setuptools/setuptools/windows_support.py
which is under your project folder. (not~/.buildozer
) .Add these lines at very beginning
import sys sys.path.append('/usr/lib/python3.6/lib-dynload')
save & enter your buildozer command again
I know this is poor work around and I am not expert in python either
The only issue with this is that the lib directory would be different on MSYS2 and some distros. I wonder if there's a particular variable that we can point to? Btw, I haven't tested MSYS but I would assume with Java 8 and all installed it would work (until it hits this error)
So how can I build an APK using colab?
:wave: @zurgeg, 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.
Let us know if this comment was made in error, and we'll be happy to reopen the issue.
this seems to have turned into a long list of losely related support requests, rather than a properly defined bug, so closing, please use the support channels for support.
Versions
Description
No matter what (installing libffi-dev, cleaning buildozer) I try, it always errors with something about No module named _ctypes while building setuptools.
buildozer.spec
Command:
Spec file:
Logs