适用于Android的Python无法构建APK

时间:2018-12-26 11:01:53

标签: android python gcc

我试图在与Windows 10一起运行的ubuntu 18上使用python for android构建apk。我遇到了关于c编译器的错误,我使用'sudo apt-get install build_essentials'安装了gcc,安装成功,但是错误仍未解决。这是“ 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 python configure 2.7, which was
generated by GNU Autoconf 2.68.  Invocation command line was

  $ /home/sabeer/.local/share/python-for-android/build/other_builds/python2/armeabi-v7a__ndk_target_19/python2/configure --host=arm-eabi --build=x86_64-linux-gnu --prefix=/home/sabeer/.local/share/python-for-android/build/other_builds/python2/armeabi-v7a__ndk_target_19/python2/python-install --enable-shared --disable-toolbox-glue --disable-framework

## --------- ##
## Platform. ##
## --------- ##

hostname = sabeer-pc
uname -m = x86_64
uname -r = 4.15.0-20-generic
uname -s = Linux
uname -v = #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018

/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/sabeer/android/android-ndk-r18b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86/bin/
PATH: /home/sabeer/android/android-ndk-r18b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/
PATH: /home/sabeer/android/android-ndk-r18b
PATH: /home/sabeer/android/sdk/tools
PATH: /home/sabeer/android/android-ndk-r18b
PATH: /home/sabeer/android/sdk/platform-tools
PATH: /home/sabeer/android/sdk/tools
PATH: /home/sabeer/.local/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
PATH: /snap/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2764: checking for --enable-universalsdk
configure:2805: result: no
configure:2814: checking for --with-universal-archs
configure:2831: result: 32-bit
configure:2988: checking MACHDEP
configure:3136: result: linux4
configure:3142: checking EXTRAPLATDIR
configure:3157: result: 
configure:3168: checking machine type as reported by uname -m
configure:3171: result: x86_64
configure:3184: checking for --without-gcc
configure:3228: result: no
configure:3249: checking for arm-eabi-gcc
configure:3276: result: /usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -isystem /home/sabeer/android/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/sabeer/android/android-ndk-r18b/sysroot -I/home/sabeer/.local/share/python-for-android/build/python-installs/unnamed_dist_72/include/python2.7
configure:3545: checking for C compiler version
configure:3554: /usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -isystem /home/sabeer/android/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/sabeer/android/android-ndk-r18b/sysroot -I/home/sabeer/.local/share/python-for-android/build/python-installs/unnamed_dist_72/include/python2.7 --version >&5
Android (4751641 based on r328903) clang version 7.0.2 (https://android.googlesource.com/toolchain/clang 003100370607242ddd5815e4a043907ea9004281) (https://android.googlesource.com/toolchain/llvm 1d739ffb0366421d383e04ff80ec2ee591315116) (based on LLVM 7.0.2svn)
Target: arm--linux-android
Thread model: posix
InstalledDir: /home/sabeer/android/android-ndk-r18b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../../../../llvm/prebuilt/linux-x86_64/bin
clang: error: unknown argument: '-mandroid'
configure:3565: $? = 1
configure:3554: /usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -isystem /home/sabeer/android/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/sabeer/android/android-ndk-r18b/sysroot -I/home/sabeer/.local/share/python-for-android/build/python-installs/unnamed_dist_72/include/python2.7 -v >&5
clang: error: unknown argument: '-mandroid'
Android (4751641 based on r328903) clang version 7.0.2 (https://android.googlesource.com/toolchain/clang 003100370607242ddd5815e4a043907ea9004281) (https://android.googlesource.com/toolchain/llvm 1d739ffb0366421d383e04ff80ec2ee591315116) (based on LLVM 7.0.2svn)
Target: arm--linux-android
Thread model: posix
InstalledDir: /home/sabeer/android/android-ndk-r18b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../../../../llvm/prebuilt/linux-x86_64/bin
configure:3565: $? = 1
configure:3554: /usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -isystem /home/sabeer/android/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/sabeer/android/android-ndk-r18b/sysroot -I/home/sabeer/.local/share/python-for-android/build/python-installs/unnamed_dist_72/include/python2.7 -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: unknown argument: '-mandroid'
clang: error: no input files
configure:3565: $? = 1
configure:3554: /usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -isystem /home/sabeer/android/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/sabeer/android/android-ndk-r18b/sysroot -I/home/sabeer/.local/share/python-for-android/build/python-installs/unnamed_dist_72/include/python2.7 -qversion >&5
clang: error: unknown argument: '-mandroid'
clang: error: unknown argument '-qversion', did you mean '--version'?
clang: error: no input files
configure:3565: $? = 1
configure:3585: checking whether the C compiler works
configure:3607: /usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -isystem /home/sabeer/android/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/sabeer/android/android-ndk-r18b/sysroot -I/home/sabeer/.local/share/python-for-android/build/python-installs/unnamed_dist_72/include/python2.7 -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -isystem /home/sabeer/android/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/sabeer/android/android-ndk-r18b/sysroot -I/home/sabeer/.local/share/python-for-android/build/python-installs/unnamed_dist_72/include/python2.7 -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -DNO_MALLINFO   --sysroot /home/sabeer/android/android-ndk-r18b/platforms/android-19/arch-arm -lm -L/home/sabeer/.local/share/python-for-android/build/libs_collections/unnamed_dist_72/armeabi-v7a conftest.c  >&5
clang: error: unknown argument: '-mandroid'
clang: error: unknown argument: '-mandroid'
configure:3611: $? = 1
configure:3649: result: no
configure: failed program was:
| /* confdefs.h */
| #define _GNU_SOURCE 1
| #define _NETBSD_SOURCE 1
| #define __BSD_VISIBLE 1
| #define _BSD_TYPES 1
| #define _DARWIN_C_SOURCE 1
| #define _XOPEN_SOURCE 600
| #define _XOPEN_SOURCE_EXTENDED 1
| #define _POSIX_C_SOURCE 200112L
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3654: error: in `/home/sabeer/.local/share/python-for-android/build/other_builds/python2/armeabi-v7a__ndk_target_19/python2':
configure:3656: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CC_set=set
ac_cv_env_CC_value='/usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -isystem /home/sabeer/android/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/sabeer/android/android-ndk-r18b/sysroot -I/home/sabeer/.local/share/python-for-android/build/python-installs/unnamed_dist_72/include/python2.7'
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -isystem /home/sabeer/android/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/sabeer/android/android-ndk-r18b/sysroot -I/home/sabeer/.local/share/python-for-android/build/python-installs/unnamed_dist_72/include/python2.7 -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -DNO_MALLINFO'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=' --sysroot /home/sabeer/android/android-ndk-r18b/platforms/android-19/arch-arm -lm -L/home/sabeer/.local/share/python-for-android/build/libs_collections/unnamed_dist_72/armeabi-v7a'
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=set
ac_cv_env_build_alias_value=x86_64-linux-gnu
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=arm-eabi
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_header_langinfo_h=no
ac_cv_prog_CC='/usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -isystem /home/sabeer/android/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/sabeer/android/android-ndk-r18b/sysroot -I/home/sabeer/.local/share/python-for-android/build/python-installs/unnamed_dist_72/include/python2.7'

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR='arm-linux-androideabi-ar'
ARCH_RUN_32BIT=''
ARFLAGS=''
BASECFLAGS=''
BLDLIBRARY=''
BLDSHARED=''
BUILDEXEEXT=''
CC='/usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -isystem /home/sabeer/android/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/sabeer/android/android-ndk-r18b/sysroot -I/home/sabeer/.local/share/python-for-android/build/python-installs/unnamed_dist_72/include/python2.7'
CCSHARED=''
CFLAGS='-DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -isystem /home/sabeer/android/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/sabeer/android/android-ndk-r18b/sysroot -I/home/sabeer/.local/share/python-for-android/build/python-installs/unnamed_dist_72/include/python2.7 -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -DNO_MALLINFO'
CFLAGSFORSHARED=''
CONFIGURE_MACOSX_DEPLOYMENT_TARGET=''
CONFIG_ARGS=' '\''--host=arm-eabi'\'' '\''--build=x86_64-linux-gnu'\'' '\''--prefix=/home/sabeer/.local/share/python-for-android/build/other_builds/python2/armeabi-v7a__ndk_target_19/python2/python-install'\'' '\''--enable-shared'\'' '\''--disable-toolbox-glue'\'' '\''--disable-framework'\'' '\''build_alias=x86_64-linux-gnu'\'' '\''host_alias=arm-eabi'\'' '\''CC=/usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -isystem /home/sabeer/android/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/sabeer/android/android-ndk-r18b/sysroot -I/home/sabeer/.local/share/python-for-android/build/python-installs/unnamed_dist_72/include/python2.7'\'' '\''CFLAGS=-DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -isystem /home/sabeer/android/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/sabeer/android/android-ndk-r18b/sysroot -I/home/sabeer/.local/share/python-for-android/build/python-installs/unnamed_dist_72/include/python2.7 -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -DNO_MALLINFO'\'' '\''LDFLAGS= --sysroot /home/sabeer/android/android-ndk-r18b/platforms/android-19/arch-arm -lm -L/home/sabeer/.local/share/python-for-android/build/libs_collections/unnamed_dist_72/armeabi-v7a'\'''
CPP=''
CPPFLAGS=''
CXX='/usr/bin/ccache arm-linux-androideabi-g++ -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -isystem /home/sabeer/android/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/sabeer/android/android-ndk-r18b/sysroot -I/home/sabeer/.local/share/python-for-android/build/python-installs/unnamed_dist_72/include/python2.7'
DEFS=''
DLINCLDIR=''
DLLLIBRARY=''
DYNLOADFILE=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
EXTRAMACHDEPPATH=''
EXTRAPLATDIR=''
FRAMEWORKALTINSTALLFIRST=''
FRAMEWORKALTINSTALLLAST=''
FRAMEWORKINSTALLAPPSPREFIX=''
FRAMEWORKINSTALLFIRST=''
FRAMEWORKINSTALLLAST=''
FRAMEWORKUNIXTOOLSPREFIX='/home/sabeer/.local/share/python-for-android/build/other_builds/python2/armeabi-v7a__ndk_target_19/python2/python-install'
GNULD=''
GREP=''
HAS_HG=''
HAVE_GETHOSTBYNAME=''
HAVE_GETHOSTBYNAME_R=''
HAVE_GETHOSTBYNAME_R_3_ARG=''
HAVE_GETHOSTBYNAME_R_5_ARG=''
HAVE_GETHOSTBYNAME_R_6_ARG=''
HGBRANCH=''
HGTAG=''
HGVERSION=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
INSTSONAME=''
LDCXXSHARED=''
LDFLAGS=' --sysroot /home/sabeer/android/android-ndk-r18b/platforms/android-19/arch-arm -lm -L/home/sabeer/.local/share/python-for-android/build/libs_collections/unnamed_dist_72/armeabi-v7a'
LDLAST=''
LDLIBRARY=''
LDLIBRARYDIR=''
LDSHARED='/usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -isystem /home/sabeer/android/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/sabeer/android/android-ndk-r18b/sysroot -I/home/sabeer/.local/share/python-for-android/build/python-installs/unnamed_dist_72/include/python2.7 -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions '
LIBC=''
LIBFFI_INCLUDEDIR=''
LIBM=''
LIBOBJS=''
LIBRARY=''
LIBS=''
LIBTOOL_CRUFT=''
LINKCC=''
LINKFORSHARED=''
LIPO_32BIT_FLAGS=''
LN=''
LTLIBOBJS=''
MACHDEP='linux4'
MACHDEP_OBJS=''
MAINCC=''
OBJEXT=''
OPT=''
OTHER_LIBTOOL_OPT=''
PACKAGE_BUGREPORT='http://bugs.python.org/'
PACKAGE_NAME='python'
PACKAGE_STRING='python 2.7'
PACKAGE_TARNAME='python'
PACKAGE_URL=''
PACKAGE_VERSION='2.7'
PATH_SEPARATOR=':'
PKG_CONFIG=''
PYTHONFRAMEWORK=''
PYTHONFRAMEWORKDIR='no-framework'
PYTHONFRAMEWORKIDENTIFIER='org.python.python'
PYTHONFRAMEWORKINSTALLDIR=''
PYTHONFRAMEWORKPREFIX=''
RANLIB='arm-linux-androideabi-ranlib'
RUNSHARED=''
SGI_ABI=''
SHELL='/bin/bash'
SHLIBS=''
SIGNAL_OBJS=''
SO=''
SOVERSION='1.0'
SRCDIRS=''
SVNVERSION=''
THREADHEADERS=''
THREADOBJ=''
TRUE=''
UNICODE_OBJS=''
UNIVERSALSDK=''
UNIVERSAL_ARCH_FLAGS=''
USE_SIGNAL_MODULE=''
USE_THREAD_MODULE=''
VERSION='2.7'
ac_ct_CC=''
bindir='${exec_prefix}/bin'
build_alias='x86_64-linux-gnu'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host_alias='arm-eabi'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/home/sabeer/.local/share/python-for-android/build/other_builds/python2/armeabi-v7a__ndk_target_19/python2/python-install'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define _GNU_SOURCE 1
#define _NETBSD_SOURCE 1
#define __BSD_VISIBLE 1
#define _BSD_TYPES 1
#define _DARWIN_C_SOURCE 1
#define _XOPEN_SOURCE 600
#define _XOPEN_SOURCE_EXTENDED 1
#define _POSIX_C_SOURCE 200112L

configure: exit 77

我已经与Android的python作战了几周,我将不胜感激。预先谢谢你。

0 个答案:

没有答案