【问题标题】:pyjnius "cannot find class" errorpyjnius“找不到类”错误
【发布时间】:2019-01-05 13:59:45
【问题描述】:

我正在尝试使用 Kivy 制作蓝牙应用,所以我需要使用 java 类,当我使用 Pyjnius 时收到此错误消息

Traceback (most recent call last):
  File "C:\Users\Omer Akbas\Desktop\My Apps (Kivy)\First\main.py", line 3, in             
<module>
    BluetoothAdapter = autoclass('android.bluetooth.BluetoothAdapter')
  File "C:\Python27\lib\site-packages\jnius\reflect.py", line 158, in 
  autoclass
    c = find_javaclass(clsname)
  File "jnius\jnius_export_func.pxi", line 25, in jnius.find_javaclass
JavaException: Class not found 'android/bluetooth/BluetoothAdapter'

【问题讨论】:

    标签: java android python kivy pyjnius


    【解决方案1】:

    如果您正在构建 Kivy 应用程序,pyjnius 会作为 Kivy 的依赖项自动安装在 APK 中,因此您无需执行除正常的 Programming Guide » Create a package for Android 文档之外的任何特殊操作。

    【讨论】:

      猜你喜欢
      • 2015-03-14
      • 2015-02-14
      • 2020-11-18
      • 1970-01-01
      • 2017-05-21
      • 2012-04-18
      • 2015-06-20
      • 2013-07-18
      • 2023-04-05
      相关资源
      最近更新 更多