plyer
plyer copied to clipboard
Android Notification error [Java ClassNotFoundException]
Version: Android 5.1.1 - Api 22 Version: Android 11 - Api 30
I've been trying to implement a notification system in my app for a while and it ends up not working at all, I tried using it natively [in this case android v4, androix], then finally I tried it with plyer, anyway tried none worked, it was always a java-related error that I have no idea how to resolve, I added packages to android.gradle_dependencies in buildozer.spec, no way has shown if it wants to work.
In both devices the error was the same, I believe it is something with my buildozer.spec, but I have no idea how to solve it.
Anyway, thanks for reading.
Below is the log with the error shown
I/python (10877): File "/home/emanuel/Documentos/Git_Github/dmyk/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/armeabi-v7a/plyer/utils.py", line 96, in _ensure_obj
I/python (10877): File "/home/emanuel/Documentos/Git_Github/dmyk/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/armeabi-v7a/plyer/platforms/android/notification.py", line 35, in <module>
I/python (10877): File "/home/emanuel/Documentos/Git_Github/dmyk/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/armeabi-v7a/plyer/platforms/android/notification.py", line 86, in AndroidNotification
I/python (10877): File "/home/emanuel/Documentos/Git_Github/dmyk/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/armeabi-v7a/android/runnable.py", line 51, in run_on_ui_thread
I/python (10877): File "/home/emanuel/Documentos/Git_Github/dmyk/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/armeabi-v7a/android/runnable.py", line 26, in __init__
I/python (10877): File "jnius/jnius_proxy.pxi", line 28, in jnius.jnius.PythonJavaClass.__init__
I/python (10877): File "jnius/jnius_proxy.pxi", line 34, in jnius.jnius.PythonJavaClass._init_j_self_ptr
I/python (10877): File "jnius/jnius_proxy.pxi", line 165, in jnius.jnius.create_proxy_instance
I/python (10877): File "/home/emanuel/Documentos/Git_Github/dmyk/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/armeabi-v7a/jnius/reflect.py", line 211, in autoclass
I/python (10877): File "jnius/jnius_export_func.pxi", line 26, in jnius.jnius.find_javaclass
I/python (10877): File "jnius/jnius_utils.pxi", line 91, in jnius.jnius.check_exception
I/python (10877): jnius.jnius.JavaException: JVM exception occurred: Didn't find class "org.jnius.NativeInvocationHandler" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]] java.lang.ClassNotFoundException
I/python (10877): Exception in thread Thread-2:
I/python (10877): Traceback (most recent call last):
I/python (10877): File "/home/emanuel/Documentos/Git_Github/dmyk/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_22/python3/Lib/threading.py", line 973, in _bootstrap_inner
I/python (10877): File "/home/emanuel/Documentos/Git_Github/dmyk/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/armeabi-v7a/jnius/__init__.py", line 87, in jnius_thread_hook
I/python (10877): File "/home/emanuel/Documentos/Git_Github/dmyk/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_22/python3/Lib/threading.py", line 910, in run
I/python (10877): File "/home/emanuel/Documentos/Git_Github/dmyk/.buildozer/android/app/download.py", line 41, in main
I/python (10877): File "/home/emanuel/Documentos/Git_Github/dmyk/.buildozer/android/app/source_notification/notification.py", line 43, in send_notification
I/python (10877): File "/home/emanuel/Documentos/Git_Github/dmyk/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/armeabi-v7a/plyer/facades/notification.py", line 84, in notify
I/python (10877): File "/home/emanuel/Documentos/Git_Github/dmyk/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/myapp/armeabi-v7a/plyer/facades/notification.py", line 93, in _notify
I/python (10877): NotImplementedError: No usable implementation found!
My plyer code:
import plyer
plyer.notification.notify(title='Test', message='Notification using plyer')