'tensorflow lite program crashing with kivy on buildozer

I tried running this github program https://github.com/tito/experiment-tensorflow-lite It is basically about running tensorflow lite using kivy on android.

I tried running the program on my pc but I got this error``

STDOUT:
patching file jnius/jnius_jvm_android.pxi
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file jnius/jnius_jvm_android.pxi.rej
patching file jnius/env.py
Hunk #1 FAILED at 185.
1 out of 1 hunk FAILED -- saving rejects to file jnius/env.py.rej


  STDERR:

[INFO]:    STDOUT:
    patching file jnius/jnius_jvm_android.pxi
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file jnius/jnius_jvm_android.pxi.rej
patching file jnius/env.py
Hunk #1 FAILED at 185.
1 out of 1 hunk FAILED -- saving rejects to file jnius/env.py.rej
[INFO]:    STDERR:
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/pls/experiment-tensorflow-lite/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1276, in <module>
    main()
  File "/home/pls/experiment-tensorflow-lite/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/home/pls/experiment-tensorflow-lite/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 725, in init
    getattr(self, command)(args)
  File "/home/pls/experiment-tensorflow-lite/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 153, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/pls/experiment-tensorflow-lite/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 212, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx,
  File "/home/pls/experiment-tensorflow-lite/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 573, in build_recipes
    recipe.apply_patches(arch)
File "/home/pls/experiment-tensorflow-lite/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 560, in apply_patches
    self.apply_patch(
  File "/home/pls/experiment-tensorflow-lite/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 263, in apply_patch
    shprint(sh.patch, "-t", "-d", build_dir, "-p1",
  File "/home/pls/experiment-tensorflow-lite/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 167, in shprint
    for line in output:
  File "/usr/local/lib/python3.8/dist-packages/sh-1.14.1-py3.8.egg/sh.py", line 911, in next
    self.wait()
  File "/usr/local/lib/python3.8/dist-packages/sh-1.14.1-py3.8.egg/sh.py", line 841, in wait
    self.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python3.8/dist-packages/sh-1.14.1-py3.8.egg/sh.py", line 865, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /usr/bin/patch -t -d /home/pls/experiment-tensorflow-lite/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/pyjnius-sdl2/armeabi-v7a__ndk_target_21/pyjnius -p1 -i /home/pls/experiment-tensorflow-lite/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/pyjnius/sdl2_jnienv_getter.patch

  STDOUT:
patching file jnius/jnius_jvm_android.pxi
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file jnius/jnius_jvm_android.pxi.rej
patching file jnius/env.py
Hunk #1 FAILED at 185.
1 out of 1 hunk FAILED -- saving rejects to file jnius/env.py.rej

I used the same buildozer.init file on the github Python version: 3.8.10 I ran the program on ubuntu virtual machine using virtual box



Solution 1:[1]

Just use command:

buildozer android clean

before:

buildozer android debug

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Muhammad Dyas Yaskur