在MacOS上建立kivy hello world的buildozer构建失败ld:错误,无存档符号表运行ranlib

问题描述

在macOS上使用buildozer为Android构建Hello World Kivy应用程序时,构建失败。 (下面附上config.log)。

我已经在论坛上搜索buildozer构建问题数周,以找到答案。其中很少有人(例如:安装clangxx,llvm,cython == 0.29.19)有助于达到当前状态,但无法进一步发展。

问题似乎是由于不正确的ranlib配置引起的,但是不知道如何解决它。请帮忙。预先感谢。

MacOS:10.15.5
的Python:3.7.6
Cython:0.29.19
Kivy:1.11.1
buildozer:1.2.0
p4a:2020.06.02

从配置日志中提取的错误消息:

configure:3858: $? = 0
configure:3847: /Users/superuser/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi21-clang -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:3858: $? = 1
configure:3847: /Users/superuser/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi21-clang -qversion >&5
clang: error: unknown argument '-qversion',did you mean '--version'?
clang: error: no input files
configure:3858: $? = 1
configure:3878: checking whether the C compiler works
configure:3900: /Users/superuser/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi21-clang -fPIC -DANDROID -D__ANDROID_API__=21 -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /opt/anaconda3/envs/CondaML/include -I/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21/sqlite3 -I/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/include -I/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1/include -I/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1/include/internal -I/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1/include/openssl -I/Users/superuser/.buildozer/android/platform/android-ndk-r19c/sysroot/usr/include -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/opt/anaconda3/envs/CondaML/lib -L/opt/anaconda3/envs/CondaML/lib -L/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21/sqlite3/obj/local/armeabi-v7a -L/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/.libs -L/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1 -L/Users/superuser/.buildozer/android/platform/android-ndk-r19c/platforms/android-21/arch-arm/usr/lib conftest.c  -lsqlite3 -lffi -lcrypto1.1 -lssl1.1 -lz >&5
/Users/superuser/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: sqlite3: no archive symbol table (run ranlib)
/Users/superuser/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: ffi: no archive symbol table (run ranlib)
/Users/superuser/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: z: no archive symbol table (run ranlib)
/Users/superuser/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: warning: cannot find entry symbol 'ad_strip_dylibs'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3904: $? = 1
configure:3942: result: no
configure: failed program was:
| /* confdefs.h */
| #define _GNU_SOURCE 1
| #define _NETBSD_SOURCE 1
| #define __BSD_VISIBLE 1
| #define _DARWIN_C_SOURCE 1
| #define _PYTHONFRAMEWORK ""
| #define _XOPEN_SOURCE 700
| #define _XOPEN_SOURCE_EXTENDED 1
| #define _POSIX_C_SOURCE 200809L
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3947: error: in `/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/android-build':
configure:3949: error: C compiler cannot create executables
See `config.log' for more details

构建日志中的错误:

[INFO]:    Building sdl2_image for armeabi-v7a
[INFO]:    Building sdl2_mixer for armeabi-v7a
[INFO]:    Building sdl2_ttf for armeabi-v7a
[INFO]:    Building sqlite3 for armeabi-v7a
[INFO]:    -> directory context /Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21/sqlite3
[INFO]:    -> running ndk-build V=1 NDK_DEBUG=1 APP_PLATFORM=android-21 APP_ABI=armeabi-v7a
[INFO]:    <- directory context /Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/python-for-android                                                                                        
[INFO]:    Building python3 for armeabi-v7a
[WARNING]: lld not found,linking without it. Consider installing lld if linker errors occur.
[INFO]:    Activating flags for sqlite3
[INFO]:    Activating flags for libffi
[INFO]:    Activating flags for openssl
[INFO]:    Activating flags for android's zlib
[INFO]:    -> directory context /Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/android-build
[INFO]:    -> running configure --host=arm-linux-androideabi --build=x86_64-apple-darwin19.5.0 --enable-shared --enable-ipv6 ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no --without-ensurepip ac_cv_little_e...(and 255 more)
Exception in thread background thread for pid 53849:                                                                                                                                                                                      
Traceback (most recent call last):
  File "/opt/anaconda3/envs/CondaML/lib/python3.7/threading.py",line 926,in _bootstrap_inner
    self.run()
  File "/opt/anaconda3/envs/CondaML/lib/python3.7/threading.py",line 870,in run
    self._target(*self._args,**self._kwargs)
  File "/opt/anaconda3/envs/CondaML/lib/python3.7/site-packages/sh.py",line 1662,in wrap
    fn(*args,**kwargs)
  File "/opt/anaconda3/envs/CondaML/lib/python3.7/site-packages/sh.py",line 2606,in background_thread
    handle_exit_code(exit_code)
  File "/opt/anaconda3/envs/CondaML/lib/python3.7/site-packages/sh.py",line 2304,in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/opt/anaconda3/envs/CondaML/lib/python3.7/site-packages/sh.py",line 877,in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_77: 

  RAN: /Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/configure --host=arm-linux-androideabi --build=x86_64-apple-darwin19.5.0 --enable-shared --enable-ipv6 ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no --without-ensurepip ac_cv_little_endian_double=yes --prefix=/usr/local --exec-prefix=/usr/local --with-openssl=/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1

  STDOUT:
checking build system type... x86_64-apple-darwin19.5.0
checking host system type... arm-unknown-linux-androideabi
checking for python3.8... no
checking for python3... python3
checking for python interpreter for cross build... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "linux"
checking for arm-linux-androideabi-gcc... /Users/superuser/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi21-clang
checking whether the C compiler works... no
configure: error: in `/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/android-build':
configure: error: C compiler cannot create executables
See `config.log' for more details


  STDERR:


Traceback (most recent call last):
  File "/opt/anaconda3/envs/CondaML/lib/python3.7/runpy.py",line 193,in _run_module_as_main
    "__main__",mod_spec)
  File "/opt/anaconda3/envs/CondaML/lib/python3.7/runpy.py",line 85,in _run_code
    exec(code,run_globals)
  File "/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py",line 1260,in <module>
    main()
  File "/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py",line 18,in main
    ToolchainCL()
  File "/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py",line 709,in __init__
    getattr(self,command)(args)
  File "/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py",line 154,in wrapper_func
    build_dist_from_args(ctx,dist,args)
  File "/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py",line 216,in build_dist_from_args
    args,"ignore_setup_py",False
  File "/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/python-for-android/pythonforandroid/build.py",line 577,in build_recipes
    recipe.build_arch(arch)
  File "/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/python3/__init__.py",line 310,in build_arch
    _env=env)
  File "/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py",line 167,in shprint
    for line in output:
  File "/opt/anaconda3/envs/CondaML/lib/python3.7/site-packages/sh.py",line 925,in next
    self.wait()
  File "/opt/anaconda3/envs/CondaML/lib/python3.7/site-packages/sh.py",line 849,in wait
    self.handle_command_exit_code(exit_code)
  File "/opt/anaconda3/envs/CondaML/lib/python3.7/site-packages/sh.py",in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_77: 

  RAN: /Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/configure --host=arm-linux-androideabi --build=x86_64-apple-darwin19.5.0 --enable-shared --enable-ipv6 ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no --without-ensurepip ac_cv_little_endian_double=yes --prefix=/usr/local --exec-prefix=/usr/local --with-openssl=/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1

  STDOUT:
checking build system type... x86_64-apple-darwin19.5.0
checking host system type... arm-unknown-linux-androideabi
checking for python3.8... no
checking for python3... python3
checking for python interpreter for cross build... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "linux"
checking for arm-linux-androideabi-gcc... /Users/superuser/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi21-clang
checking whether the C compiler works... no
configure: error: in `/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/android-build':
configure: error: C compiler cannot create executables
See `config.log' for more details


  STDERR:

# Command failed: /opt/anaconda3/envs/CondaML/bin/python -m pythonforandroid.toolchain create --dist_name=kivyhelloworld --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21
# ENVIRONMENT:
#     AS = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-as'
#     LDFLAGS = ('-Wl,-dead_strip_dylibs '
 '-Wl,/opt/anaconda3/envs/CondaML/lib -L/opt/anaconda3/envs/CondaML/lib')
#     AR = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-ar'
#     CODESIGN_ALLOCATE = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-codesign_allocate'
#     HOST = 'x86_64-apple-darwin13.4.0'
#     TERM = 'xterm-256color'
#     SHELL = '/bin/bash'
#     NM = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-nm'
#     CPPFLAGS = ('-D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem '
 '/opt/anaconda3/envs/CondaML/include')
#     TMPDIR = '/var/folders/4s/yq2c801s65xf_3w05kcnghr00000gn/T/'
#     PAGESTUFF = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-pagestuff'
#     CONDA_SHLVL = '2'
#     LIPO = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-lipo'
#     CONDA_PROMPT_MODIFIER = '(CondaML) '
#     GSETTINGS_SCHEMA_DIR_CONDA_BACKUP = ''
#     SIZE = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-size'
#     NMEDIT = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-nmedit'
#     INSTALL_NAME_TOOL = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-install_name_tool'
#     SEGEDIT = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-segedit'
#     SEG_HACK = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-seg_hack'
#     USER = 'superuser'
#     CLANGXX = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-clang++'
#     CONDA_BACKUP_HOST = 'x86_64-apple-darwin13.4.0'
#     LIBTOOL = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-libtool'
#     CONDA_EXE = '/opt/anaconda3/bin/conda'
#     OTOOL = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-otool'
#     SSH_AUTH_SOCK = '/private/tmp/com.apple.launchd.pqKmgyPLQL/Listeners'
#     __CF_USER_TEXT_ENCODING = '0x1F5:0x0:0x0'
#     CXXFLAGS = ('-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE '
 '-fstack-protector-strong -O2 -pipe -stdlib=libc++ '
 '-fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 -isystem '
 '/opt/anaconda3/envs/CondaML/include')
#     CONDA_BUILD_SYSROOT = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk'
#     STRINGS = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-strings'
#     _CE_CONDA = ''
#     CHECKSYMS = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-checksyms'
#     CONDA_PREFIX_1 = '/opt/anaconda3'
#     PATH = '/Users/superuser/.buildozer/android/platform/apache-ant-1.9.4/bin:/opt/anaconda3/envs/CondaML/bin:/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin'
#     GSETTINGS_SCHEMA_DIR = '/opt/anaconda3/envs/CondaML/share/glib-2.0/schemas'
#     TERMINAL_EMULATOR = 'JetBrains-JediTerm'
#     DEBUG_CXXFLAGS = ('-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE '
 '-fstack-protector-strong -O2 -pipe -stdlib=libc++ '
 '-fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 -Og -g -Wall '
 '-Wextra -isystem /opt/anaconda3/envs/CondaML/include')
#     LD = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-ld'
#     CONDA_PREFIX = '/opt/anaconda3/envs/CondaML'
#     PWD = '/Users/superuser/Documents/PyCharmProjects/KivyProjects/FirstKivyMD'
#     STRIP = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-strip'
#     JAVA_HOME = '/Users/superuser/Dev/jdk-14.0.2.jdk/Contents/Home'
#     XPC_FLAGS = '0x0'
#     REDO_PREBINDING = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-redo_prebinding'
#     CXX = 'x86_64-apple-darwin13.4.0-clang++'
#     CLANG = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-clang'
#     _CE_M = ''
#     XPC_SERVICE_NAME = '0'
#     SHLVL = '1'
#     HOME = '/Users/superuser'
#     CFLAGS = ('-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE '
 '-fstack-protector-strong -O2 -pipe -isystem '
 '/opt/anaconda3/envs/CondaML/include')
#     _CONDA_PYTHON_SYSCONFIGDATA_NAME = '_sysconfigdata_x86_64_apple_darwin13_4_0'
#     INDR = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-indr'
#     CONDA_PYTHON_EXE = '/opt/anaconda3/bin/python'
#     LOGNAME = 'superuser'
#     LC_CTYPE = 'UTF-8'
#     CONDA_DEFAULT_ENV = 'CondaML'
#     DEBUG_CFLAGS = ('-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE '
 '-fstack-protector-strong -O2 -pipe -Og -g -Wall -Wextra -isystem '
 '/opt/anaconda3/envs/CondaML/include')
#     RANLIB = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-ranlib'
#     CMAKE_PREFIX_PATH = ':/opt/anaconda3/envs/CondaML'
#     CC = 'x86_64-apple-darwin13.4.0-clang'
#     SEG_ADDR_TABLE = '/opt/anaconda3/envs/CondaML/bin/x86_64-apple-darwin13.4.0-seg_addr_table'
#     LDFLAGS_LD = ('-pie -headerpad_max_install_names -dead_strip_dylibs -rpath '
 '/opt/anaconda3/envs/CondaML/lib -L/opt/anaconda3/envs/CondaML/lib')
#     _ = '/opt/anaconda3/envs/CondaML/bin/buildozer'
#     PACKAGES_PATH = '/Users/superuser/.buildozer/android/packages'
#     ANDROIDSDK = '/Users/superuser/.buildozer/android/platform/android-sdk'
#     ANDROIDNDK = '/Users/superuser/.buildozer/android/platform/android-ndk-r19c'
#     ANDROIDAPI = '27'
#     ANDROIDMINAPI = '21'
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log,and search for it before
# raising an issue with buildozer itself.
# In case of a bug report,please add a full log with log_level = 2

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...