从kivy项目导出APK文件时出错

问题描述 投票:0回答:1

我想将我的 kivy 应用程序导出到 APK,但出现以下错误...
我在 Debian 12 上做过一次,现在在 Ubuntu 20.04 上做过一次,但两次都遇到了同样的错误。
Python版本:3.8.10
Buildozer 版本:1.5.0
我运行了这段代码:

biuldozer -v android debug
但我收到了这个错误:

[INFO]:    Trying first build of pyjnius to get cython files: this is expected to fail
[DEBUG]:   -> running python3 setup.py build_ext -v
[DEBUG]:    warning: [options] bootstrap class path not set in conjunction with -source 1.7
[DEBUG]:    1 warning
[DEBUG]:    running build_ext
[DEBUG]:    building 'jnius' extension
[DEBUG]:    creating build
[DEBUG]:    creating build/temp.linux-x86_64-3.10
[DEBUG]:    creating build/temp.linux-x86_64-3.10/jnius
[DEBUG]:    /home/abr/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -I/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include -DANDROID -I/home/abr/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/rooyesh/arm64-v8a/include/python3.1 -fPIC -I/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build -c jnius/jnius.c -o build/temp.linux-x86_64-3.10/jnius/jnius.o
[DEBUG]:    clang-14: error: no such file or directory: 'jnius/jnius.c'
[DEBUG]:    clang-14: error: no input files
[DEBUG]:    error: command '/home/abr/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit code 1
Exception in thread background thread for pid 36642:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/abr/.local/lib/python3.8/site-packages/sh.py", line 1641, in wrap
    fn(*rgs, **kwargs)
  File "/home/abr/.local/lib/python3.8/site-packages/sh.py", line 2569, in background_thread
    handle_exit_code(exit_code)
  File "/home/abr/.local/lib/python3.8/site-packages/sh.py", line 2269, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/abr/.local/lib/python3.8/site-packages/sh.py", line 869, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v

  STDOUT:
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
running build_ext
building 'jnius' extension
creating build
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/jnius
/home/abr/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -I/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include -DANDROID -I/home/abr/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/rooyesh/arm64-v8a/include/python3.1 -fPIC -I/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build -c jnius/jnius.c -o build/temp.linux-x86_64-3.10/jnius/jnius.o
clang-14: error: no such file or directory: 'jnius/jnius.c'
clang-14: error: no input files
error: command '/home/abr/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit code 1


  STDERR:

[INFO]:    pyjnius first build failed (as expected)
[INFO]:    Running cython where appropriate
[INFO]:    Cythonize jnius/jnius.pyx
[DEBUG]:   -> running python3 -cimport sys; from Cython.Compiler.Main import setuptools_main; sys.exit(setuptools_main()); ./jnius/jnius.pyx
[DEBUG]:    /home/abr/.local/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/pyjnius-sdl2/arm64-v8a__ndk_target_21/pyjnius/jnius/jnius.pyx
[DEBUG]:      tree = Parsing.p_module(s, pxd, full_module_name)
[DEBUG]:   -> running python3 setup.py build_ext -v
[DEBUG]:    warning: [options] bootstrap class path not set in conjunction with -source 1.7
[DEBUG]:    1 warning
[DEBUG]:    running build_ext
[DEBUG]:    building 'jnius' extension
[DEBUG]:    /home/abr/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -I/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include -DANDROID -I/home/abr/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/rooyesh/arm64-v8a/include/python3.1 -fPIC -I/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build -c jnius/jnius.c -o build/temp.linux-x86_64-3.10/jnius/jnius.o
[DEBUG]:    jnius/jnius.c:12406:19: warning: assigning to 'jchar *' (aka 'unsigned short *') from 'const jchar *' (aka 'const unsigned short *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
[DEBUG]:      __pyx_v_j_chars = (__pyx_v_j_env[0])->GetStringChars(__pyx_v_j_env, __pyx_v_j_string, NULL);
[DEBUG]:                      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[DEBUG]:    jnius/jnius.c:54433:5: error: expression is not assignable
[DEBUG]:        ++Py_REFCNT(o);
[DEBUG]:        ^ ~~~~~~~~~~~~
[DEBUG]:    jnius/jnius.c:54435:5: error: expression is not assignable
[DEBUG]:        --Py_REFCNT(o);
[DEBUG]:        ^ ~~~~~~~~~~~~
[DEBUG]:    jnius/jnius.c:54549:5: error: expression is not assignable
[DEBUG]:        ++Py_REFCNT(o);
[DEBUG]:        ^ ~~~~~~~~~~~~
[DEBUG]:    jnius/jnius.c:54551:5: error: expression is not assignable
[DEBUG]:        --Py_REFCNT(o);
[DEBUG]:        ^ ~~~~~~~~~~~~
[DEBUG]:    jnius/jnius.c:54803:5: error: expression is not assignable
[DEBUG]:        ++Py_REFCNT(o);
[DEBUG]:        ^ ~~~~~~~~~~~~
[DEBUG]:    jnius/jnius.c:54805:5: error: expression is not assignable
[DEBUG]:        --Py_REFCNT(o);
[DEBUG]:        ^ ~~~~~~~~~~~~
[DEBUG]:    jnius/jnius.c:55697:5: error: expression is not assignable
[DEBUG]:        ++Py_REFCNT(o);
[DEBUG]:        ^ ~~~~~~~~~~~~
[DEBUG]:    jnius/jnius.c:55699:5: error: expression is not assignable
[DEBUG]:        --Py_REFCNT(o);
[DEBUG]:        ^ ~~~~~~~~~~~~
[DEBUG]:    jnius/jnius.c:56008:5: error: expression is not assignable
[DEBUG]:        ++Py_REFCNT(o);
[DEBUG]:        ^ ~~~~~~~~~~~~
[DEBUG]:    jnius/jnius.c:56010:5: error: expression is not assignable
[DEBUG]:        --Py_REFCNT(o);
[DEBUG]:        ^ ~~~~~~~~~~~~
[DEBUG]:    jnius/jnius.c:56258:5: error: expression is not assignable
[DEBUG]:        ++Py_REFCNT(o);
[DEBUG]:        ^ ~~~~~~~~~~~~
[DEBUG]:    jnius/jnius.c:56260:5: error: expression is not assignable
[DEBUG]:        --Py_REFCNT(o);
[DEBUG]:        ^ ~~~~~~~~~~~~
[DEBUG]:    jnius/jnius.c:59573:16: warning: 'PyUnicode_FromUnicode' is deprecated [-Wdeprecated-declarations]
[DEBUG]:            return PyUnicode_FromUnicode(NULL, 0);
[DEBUG]:                   ^
[DEBUG]:    /home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/cpython/unicodeobject.h:551:1: note: 'PyUnicode_FromUnicode' has been explicitly marked deprecated here
[DEBUG]:    Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
[DEBUG]:    ^
[DEBUG]:    /home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
[DEBUG]:    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
[DEBUG]:                                                         ^
[DEBUG]:    jnius/jnius.c:60809:16: warning: 'PyUnicode_FromUnicode' is deprecated [-Wdeprecated-declarations]
[DEBUG]:            return PyUnicode_FromUnicode(NULL, 0);
[DEBUG]:                   ^
[DEBUG]:    /home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/cpython/unicodeobject.h:551:1: note: 'PyUnicode_FromUnicode' has been explicitly marked deprecated here
[DEBUG]:    Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
[DEBUG]:    ^
[DEBUG]:    /home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
[DEBUG]:    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
[DEBUG]:                                                         ^
[DEBUG]:    3 warnings and 12 errors generated.
[DEBUG]:    error: command '/home/abr/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit code 1
Exception in thread background thread for pid 36670:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/abr/.local/lib/python3.8/site-packages/sh.py", line 1641, in wrap
    fn(*rgs, **kwargs)
  File "/home/abr/.local/lib/python3.8/site-packages/sh.py", line 2569, in background_thread
    handle_exit_code(exit_code)
  File "/home/abr/.local/lib/python3.8/site-packages/sh.py", line 2269, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/abr/.local/lib/python3.8/site-packages/sh.py", line 869, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v

  STDOUT:
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
running build_ext
building 'jnius' extension
/home/abr/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -I/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include -DANDROID -I/home/abr/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/rooyesh/arm64-v8a/include/python3.1 -fPIC -I/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build -c jnius/jnius.c -o build/temp.linux-x86_64-3.10/jnius/jnius.o
jnius/jnius.c:12406:19: warning: assigning to 'jchar *' (aka 'unsigned short *') from 'const jchar *' (aka 'const unsigned short *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  __pyx_v_j_chars = (__pyx_v_j_env[0])->GetStringChars(__pyx_v_j_env, __pyx_v_j_string, NULL);
                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jnius/jnius.c:54433:5: error: expression is not assignable
    ++Py_REFCNT(o);
    ^ ~~~~~~~~~~~~
jnius/jnius.c:54435:5: error: expression is not assignable
    --Py_REFCNT(o);
    ^ ~~~~~~~~~~~~
jnius/jnius.c:54549:5: error: expression is not assignable
    ++Py_REFCNT(o);
    ^ ~~~~~~~~~~~~
jnius/jnius.c:54551:5: error: expression is not assignable
    --Py_REFCNT(o);
    ^ ~~~~~~~~~~~~
jnius/jnius.c:54803:5: error: expression is not assignable
    ++Py_REFCNT(o);
    ^ ~~~~~~~~~~~~
jnius/jnius.c:54805:5: error: expression is not assignable
    --Py_REFCNT(o);
    ^ ~~~~~~~~~~~~
jnius/jnius.c:55697:5: error: expression is not assignable
    ++Py_REFCNT(o);
    ^ ~~~~~~~~~~~~
jnius/jnius.c:55699:5: error: expression is not assignable
    --Py_REFCNT(o);
    ^ ~~~~~~~~~~~~
jnius/jnius.c:56008:5: error: expression is not assignable
    ++Py_REFCNT(o);
    ^ ~~~~~~~~~~~~
jnius/jnius.c:56010:5: error: expression is not assignable
    --Py_REFCNT(o);
    ^ ~~~~~~~~~~~~
jnius/jnius.c:56258:5: error: expression is not assignable
    ++Py_REFCNT(o);
    ^ ~~~~~~~~~~~~
jnius/jnius.c:56260:5: error: expression is not assignable
    --Py_REFCNT(o);
    ^ ~~~~~~~~~~~~
jnius/jnius.c:59573:16: warning: 'PyUnicode_FromUnicode' is deprecated [-Wdeprecated-declarations]
        return PyUnicode_FromUnicode(NULL, 0);
               ^
/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/cpython/unicodeobject.h:551:1: note: 'PyUnicode_FromUnicode' has been explicitly marked deprecated here
Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
^
/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                     ^
jnius/jnius.c:60809:16: warning: 'PyUnicode_FromUnicode' is deprecated [-Wdeprecated-declarations]
        return PyUnicode_FromUnicode(NULL, 0);
               ^
/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/cpython/unicodeobject.h:551:1: note: 'PyUnicode_FromUnicode' has been explicitly marked deprecated here
Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
^
/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                     ^
3 warnings and 12 errors generated.
error: command '/home/abr/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit code 1


  STDERR:

[INFO]:    STDOUT (last 20 lines of 64):
    jnius/jnius.c:59573:16: warning: 'PyUnicode_FromUnicode' is deprecated [-Wdeprecated-declarations]  
        return PyUnicode_FromUnicode(NULL, 0);  
               ^    
/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/cpython/unicodeobject.h:551:1: note: 'PyUnicode_FromUnicode' has been explicitly marked deprecated here 
Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode( 
^   
/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'  
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))   
                                                     ^  
jnius/jnius.c:60809:16: warning: 'PyUnicode_FromUnicode' is deprecated [-Wdeprecated-declarations]  
        return PyUnicode_FromUnicode(NULL, 0);  
               ^    
/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/cpython/unicodeobject.h:551:1: note: 'PyUnicode_FromUnicode' has been explicitly marked deprecated here 
Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode( 
^   
/home/abr/Desktop/nahal/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'  
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))   
                                                     ^  
3 warnings and 12 errors generated. 
error: command '/home/abr/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang' failed with exit code 1

我搜索了很多,但找不到答案。
谢谢你的帮助...

python android kivy buildozer pyjnius
1个回答
0
投票

在 buildozer.spec 文件的要求部分中,确保您拥有应用程序所依赖的所有要求。如果您发布您的 buildozer.spec 文件,将会更容易为您提供帮助。

© www.soinside.com 2019 - 2024. All rights reserved.