Error while exporting APK file from kivy project

79 Views Asked by At

I want to export my kivy app to APK but I get the following error...
I did this once on Debian 12 and now on Ubuntu 20.04 but I got the same error both times.
Python version: 3.8.10
Buildozer version: 1.5.0
I ran this code: biuldozer -v android debug but I got this error:

[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

I searched a lot but I couldn't find the answer.
Thank you for your helping...

1

There are 1 best solutions below

0
On

In the requirement section of your buildozer.spec file, make sure you have all the requirements that your app depends on. It will be easier to help you if you post your buildozer.spec file. Also, it's buildozer -v android debug not "biuldozer -v android debug". You made a spelling error which can also cause errors. Again it's hard to guide you in the right direction without looking at the buildozer.spec file.