Unable to connect to Bluetooth (DSD Tech HC-05) from Kivy App

Hi,

I keep getting the below error when I try to compile or execute my Kivy App to connect to Bluetooth using PyJnius. I tried to package the App using Buildozer and then run the APK in Android phone but the minute I click the button with the code to run the Bluetooth adapter, it crashes.

BluetoothAdapter = autoclass('android.bluetooth.BluetoothAdapter')
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\eiaro\PycharmProjects\install-check\pythonProject\.venv\Lib\site-packages\jnius\reflect.py", line 209, in autoclass
    c = find_javaclass(clsname)
        ^^^^^^^^^^^^^^^^^^^^^^^
  File "jnius\\jnius_export_func.pxi", line 22, in jnius.find_javaclass
  File "jnius\\jnius_utils.pxi", line 79, in jnius.check_exception
jnius.JavaException: JVM exception occurred: android/bluetooth/BluetoothAdapter java.lang.NoClassDefFoundError

Process finished with exit code 1
 

Any help is appreciated.

Thanks

Shifa

0
1 comment

Hi Shifasafeeq, would you kindly clarify, how is this issue related to PyCharm?

Would this thread with similar issues be of any use?

0

Please sign in to leave a comment.