-1

Sou estagiário de programação e estou enfrentando dificuldades ao tentar fazer o deploy do meu aplicativo Kivy para Android. Eu segui as etapas de configuração do arquivo 'buildozer.spec' conforme a documentação oficial, mas estou encontrando um erro durante o processo de deploy do app no celular, lembrando que estou faendo esse processo pelo virtual box utilizando o Ubuntu como sistema operacional

COMANDO UTILIZADO NO TERMINAL: buildozer android debug deploy run logcat

LOG:

[DEBUG]:    performance hint: kivy/graphics/cgl_backend/cgl_debug.pyx:1285:5: Exception check on 'gil_dbgViewport' will always require the GIL to be acquired.
[DEBUG]:    Possible solutions:
[DEBUG]:        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
[DEBUG]:        2. Use an 'int' return type on the function to allow an error code to be returned.
[INFO]:    Cythonize kivy/graphics/cgl_backend/cgl_gl.pyx
[DEBUG]:   -> running python3 -cimport sys; from Cython.Compiler.Main import setuptools_main; sys.exit(setuptools_main()); ./kivy/graphics/cgl_backend/cgl_gl.pyx
[DEBUG]:    /home/python/.local/lib/python3.10/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /home/python/aplicativotop/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/kivy/armeabi-v7a__ndk_target_21/kivy/kivy/graphics/cgl_backend/cgl_gl.pyx
[DEBUG]:      tree = Parsing.p_module(s, pxd, full_module_name)
[DEBUG]:    warning: kivy/graphics/cgl_backend/cgl_gl.pyx:148:4: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
[DEBUG]:    warning: kivy/graphics/cgl_backend/cgl_gl.pyx:155:4: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
[INFO]:    Cythonize kivy/graphics/cgl_backend/cgl_sdl2.pyx
[DEBUG]:   -> running python3 -cimport sys; from Cython.Compiler.Main import setuptools_main; sys.exit(setuptools_main()); ./kivy/graphics/cgl_backend/cgl_sdl2.pyx
[DEBUG]:    /home/python/.local/lib/python3.10/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /home/python/aplicativotop/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/kivy/armeabi-v7a__ndk_target_21/kivy/kivy/graphics/cgl_backend/cgl_sdl2.pyx
[DEBUG]:      tree = Parsing.p_module(s, pxd, full_module_name)
[DEBUG]:    warning: kivy/graphics/cgl_backend/cgl_sdl2.pyx:10:0: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
[DEBUG]:    warning: kivy/graphics/cgl_backend/cgl_sdl2.pyx:20:4: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
[INFO]:    Cythonize kivy/lib/gstplayer/_gstplayer.pyx
[DEBUG]:   -> running python3 -cimport sys; from Cython.Compiler.Main import setuptools_main; sys.exit(setuptools_main()); ./kivy/lib/gstplayer/_gstplayer.pyx
[DEBUG]:    /home/python/.local/lib/python3.10/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /home/python/aplicativotop/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/kivy/armeabi-v7a__ndk_target_21/kivy/kivy/lib/gstplayer/_gstplayer.pyx
[DEBUG]:      tree = Parsing.p_module(s, pxd, full_module_name)
[DEBUG]:    performance hint: kivy/lib/gstplayer/_gstplayer.pyx:126:5: Exception check on '_on_appsink_sample' will always require the GIL to be acquired.
[DEBUG]:    Possible solutions:
[DEBUG]:        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
[DEBUG]:        2. Use an 'int' return type on the function to allow an error code to be returned.
[DEBUG]:    performance hint: kivy/lib/gstplayer/_gstplayer.pyx:135:5: Exception check on '_on_gstplayer_message' will always require the GIL to be acquired.
[DEBUG]:    Possible solutions:
[DEBUG]:        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
[DEBUG]:        2. Use an 'int' return type on the function to allow an error code to be returned.
[DEBUG]:    
[DEBUG]:    Error compiling Cython file:
[DEBUG]:    ------------------------------------------------------------
[DEBUG]:    ...
[DEBUG]:                raise GstPlayerException('Unable to get the bus from the pipeline')
[DEBUG]:    
[DEBUG]:            gst_bus_enable_sync_message_emission(self.bus)
[DEBUG]:            if self.eos_cb or self.message_cb:
[DEBUG]:                self.hid_message = c_bus_connect_message(
[DEBUG]:                        self.bus, _on_gstplayer_message, <void *>self)
[DEBUG]:                                  ^
[DEBUG]:    ------------------------------------------------------------
[DEBUG]:    
[DEBUG]:    kivy/lib/gstplayer/_gstplayer.pyx:228:30: Cannot assign type 'void (void *, GstMessage *) except * nogil' to 'buscallback_t'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (void *, GstMessage *) except * nogil'.
[DEBUG]:    
[DEBUG]:    Error compiling Cython file:
[DEBUG]:    ------------------------------------------------------------
[DEBUG]:    ...
[DEBUG]:            # attach the callback
[DEBUG]:            # NOTE no need to create a weakref here, as we manage to grab/release
[DEBUG]:            # the reference of self in the set_sample_callback() method.
[DEBUG]:            if self.sample_cb:
[DEBUG]:                self.hid_sample = c_appsink_set_sample_callback(
[DEBUG]:                        self.appsink, _on_appsink_sample, <void *>self)
[DEBUG]:                                      ^
[DEBUG]:    ------------------------------------------------------------
[DEBUG]:    
[DEBUG]:    kivy/lib/gstplayer/_gstplayer.pyx:269:34: Cannot assign type 'void (void *, int, int, char *, int) except * nogil' to 'appcallback_t'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (void *, int, int, char *, int) except * nogil'.
[DEBUG]:    
[DEBUG]:    Error compiling Cython file:
[DEBUG]:    ------------------------------------------------------------
[DEBUG]:    ...
[DEBUG]:            if self.appsink != NULL:
[DEBUG]:                gst_element_get_state(self.pipeline, &current_state,
[DEBUG]:                        &pending_state, <GstClockTime>GST_SECOND)
[DEBUG]:                if current_state != GST_STATE_PLAYING:
[DEBUG]:                    c_appsink_pull_preroll(
[DEBUG]:                        self.appsink, _on_appsink_sample, <void *>self)
[DEBUG]:                                      ^
[DEBUG]:    ------------------------------------------------------------
[DEBUG]:    
[DEBUG]:    kivy/lib/gstplayer/_gstplayer.pyx:418:34: Cannot assign type 'void (void *, int, int, char *, int) except * nogil' to 'appcallback_t'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (void *, int, int, char *, int) except * nogil'.
Exception in thread background thread for pid 5958:
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/home/python/.local/lib/python3.10/site-packages/sh.py", line 1641, in wrap
    fn(*rgs, **kwargs)
  File "/home/python/.local/lib/python3.10/site-packages/sh.py", line 2569, in background_thread
    handle_exit_code(exit_code)
  File "/home/python/.local/lib/python3.10/site-packages/sh.py", line 2269, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/python/.local/lib/python3.10/site-packages/sh.py", line 869, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /usr/bin/python3 '-cimport sys; from Cython.Compiler.Main import setuptools_main; sys.exit(setuptools_main());' ./kivy/lib/gstplayer/_gstplayer.pyx

  STDOUT:
/home/python/.local/lib/python3.10/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /home/python/aplicativotop/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/kivy/armeabi-v7a__ndk_target_21/kivy/kivy/lib/gstplayer/_gstplayer.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
performance hint: kivy/lib/gstplayer/_gstplayer.pyx:126:5: Exception check on '_on_appsink_sample' will always require the GIL to be acquired.
Possible solutions:
    1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
    2. Use an 'int' return type on the function to allow an error code to be returned.
performance hint: kivy/lib/gstplayer/_gstplayer.pyx:135:5: Exception check on '_on_gstplayer_message' will always require the GIL to be acquired.
Possible solutions:
    1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
    2. Use an 'int' return type on the function to allow an error code to be returned.

Error compiling Cython file:
------------------------------------------------------------
...
            raise GstPlayerException('Unable to get the bus from the pipeline')

        gst_bus_enable_sync_message_emission(self.bus)
        if self.eos_cb or self.message_cb:
            self.hid_message = c_bus_connect_message(
                    self.bus, _on_gstplayer_message, <void *>self)
                              ^
------------------------------------------------------------

kivy/lib/gstplayer/_gstplayer.pyx:228:30: Cannot assign type 'void (void *, GstMessage *) except * nogil' to 'buscallback_t'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (void *, GstMessage *) except * nogil'.

Error compiling Cython file:
------------------------------------------------------------
...
        # attach the callback
        # NOTE no need to create a weakref here, as we manage to grab/release
        # the reference of self in the set_sample_callback() method.
        if self.sample_cb:
            self.hid_sample = c_appsink_set_sample_callback(
                    self.appsink, _on_appsink_sample, <void *>self)
                                  ^
------------------------------------------------------------

kivy/lib/gstplayer/_gstplayer.pyx:269:34: Cannot assign type 'void (void *, int, int, char *, int) except * nogil' to 'appcallback_t'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (void *, int, int, char *, int) except * nogil'.

Error compiling Cython file:
------------------------------------------------------------
...
        if self.appsink != NULL:
            gst_element_get_state(self.pipeline, &current_state,
                    &pending_state, <GstClockTime>GST_SECOND)
            if current_state != GST_STATE_PLAYING:
                c_appsink_pull_preroll(
                    self.appsink, _on_appsink_sample, <void *>self)
                                  ^
------------------------------------------------------------

kivy/lib/gstplayer/_gstplayer.pyx:418:34: Cannot assign type 'void (void *, int, int, char *, int) except * nogil' to 'appcallback_t'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (void *, int, int, char *, int) except * nogil'.


  STDERR:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/python/aplicativotop/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1262, in <module>
    main()
  File "/home/python/aplicativotop/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/home/python/aplicativotop/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 680, in _init_
    getattr(self, command)(args)
  File "/home/python/aplicativotop/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 99, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/python/aplicativotop/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 158, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx,
  File "/home/python/aplicativotop/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 504, in build_recipes
    recipe.build_arch(arch)
  File "/home/python/aplicativotop/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1028, in build_arch
    self.build_cython_components(arch)
  File "/home/python/aplicativotop/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1053, in build_cython_components
    self.cythonize_build(env=env)
  File "/home/python/aplicativotop/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/kivy/_init_.py", line 38, in cythonize_build
    super().cythonize_build(env, build_dir=build_dir)
  File "/home/python/aplicativotop/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1101, in cythonize_build
    self.cythonize_file(env, build_dir, join(root, filename))
  File "/home/python/aplicativotop/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/kivy/_init_.py", line 59, in cythonize_file
    super().cythonize_file(env, build_dir, filename)
  File "/home/python/aplicativotop/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1090, in cythonize_file
    shprint(python_command, "-c"
  File "/home/python/aplicativotop/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 167, in shprint
    for line in output:
  File "/home/python/.local/lib/python3.10/site-packages/sh.py", line 915, in next
    self.wait()
  File "/home/python/.local/lib/python3.10/site-packages/sh.py", line 845, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/python/.local/lib/python3.10/site-packages/sh.py", line 869, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /usr/bin/python3 '-cimport sys; from Cython.Compiler.Main import setuptools_main; sys.exit(setuptools_main());' ./kivy/lib/gstplayer/_gstplayer.pyx

  STDOUT:
/home/python/.local/lib/python3.10/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /home/python/aplicativotop/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/kivy/armeabi-v7a__ndk_target_21/kivy/kivy/lib/gstplayer/_gstplayer.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
performance hint: kivy/lib/gstplayer/_gstplayer.pyx:126:5: Exception check on '_on_appsink_sample' will always require the GIL to be acquired.
Possible solutions:
    1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
    2. Use an 'int' return type on the function to allow an error code to be returned.
performance hint: kivy/lib/gstplayer/_gstplayer.pyx:135:5: Exception check on '_on_gstplayer_message' will always require the GIL to be acquired.
Possible solutions:
    1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
    2. Use an 'int' return type on the function to allow an error code to be returned.

Error compiling Cython file:
------------------------------------------------------------
...
            raise GstPlayerException('Unable to get the bus from the pipeline')

        gst_bus_enable_sync_message_emission(self.bus)
        if self.eos_cb or self.message_cb:
            self.hid_message = c_bus_connect_message(
                    self.bus, _on_gstplayer_message, <void *>self)
                              ^
------------------------------------------------------------

kivy/lib/gstplayer/_gstplayer.pyx:228:30: Cannot assign type 'void (void *, GstMessage *) except * nogil' to 'buscallback_t'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (void *, GstMessage *) except * nogil'.

Error compiling Cython file:
------------------------------------------------------------
...
        # attach the callback
        # NOTE no need to create a weakref here, as we manage to grab/release
        # the reference of self in the set_sample_callback() method.
        if self.sample_cb:
            self.hid_sample = c_appsink_set_sample_callback(
                    self.appsink, _on_appsink_sample, <void *>self)
                                  ^
------------------------------------------------------------

kivy/lib/gstplayer/_gstplayer.pyx:269:34: Cannot assign type 'void (void *, int, int, char *, int) except * nogil' to 'appcallback_t'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (void *, int, int, char *, int) except * nogil'.

Error compiling Cython file:
------------------------------------------------------------
...
        if self.appsink != NULL:
            gst_element_get_state(self.pipeline, &current_state,
                    &pending_state, <GstClockTime>GST_SECOND)
            if current_state != GST_STATE_PLAYING:
                c_appsink_pull_preroll(
                    self.appsink, _on_appsink_sample, <void *>self)
                                  ^
------------------------------------------------------------

kivy/lib/gstplayer/_gstplayer.pyx:418:34: Cannot assign type 'void (void *, int, int, char *, int) except * nogil' to 'appcallback_t'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (void *, int, int, char *, int) except * nogil'.

Passos que segui até agora:

1-Instalei as dependências conforme as instruções no site oficial do Kivy.

2-estou utilizando o kivy=2.2.1 no meu aplicativo.

3-o celular que estou utilizando para fazer o deploy é um ssg galaxy S8.

4-o app utiliza pyrebase e gspread para acessar o banco de dados.

segue a baixo algumas informações que coloquei no arquivo "buildozer.spec"

# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = python3,kivy,certifi,requests,gspread,pyrebase,pillow

Agradeço antecipadamente por qualquer orientação ou sugestão sobre como resolver esse problema. Se precisarem de mais informações, estou à disposição para fornecer.

Obrigado!

0

Você deve fazer log-in para responder a esta pergunta.

Pesquise outras perguntas com a tag .