Android Service - Java - No implementation found qt5.android.bluetooth.QtBluetoothLE.leScanResult
Solved
Mobile and Embedded
-
wrote on 17 Sept 2021, 12:46 last edited by
Hi!
i try to implement the QtBluetooth scan devices in an Android application, as service but when i try
m_deviceDiscoveryAgent = new QBluetoothDeviceDiscoveryAgent(this); ... m_deviceDiscoveryAgent->start(QBluetoothDeviceDiscoveryAgent::LowEnergyMethod);
i got this error:
No implementation found for void org.qtproject.qt5.android.bluetooth.QtBluetoothLE.leScanResult09-17 13:28:21.081 15661 15688 W libservice_armeabi-v7a.so: qt.bluetooth.android: ACCESS_COARSE|FINE_LOCATION permission available 09-17 13:28:21.084 15661 15688 D libservice_armeabi-v7a.so: qt.bluetooth.android: Location turned on 09-17 13:28:21.111 15661 15688 D QtBluetoothGatt: New BTLE scanning API 09-17 13:28:21.122 31471 31541 I bt_stack: [INFO:gatt_api.cc(961)] GATT_Register f2acdb98-0fd4-caef-0443-741364f08dc3 09-17 13:28:21.123 31471 31541 I bt_stack: [INFO:gatt_api.cc(981)] allocated gatt_if=17 09-17 13:28:21.125 15661 15685 D BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=17 mScannerId=0 09-17 13:28:21.126 1297 1981 E WificondControl: Noise: 0, Snr: 0, Chload: -1 09-17 13:28:21.128 2451 16593 D BT_CHR: BtChrManager: notifyEvent eventId = 11 09-17 13:28:21.128 2451 10051 D Nc_Chr_BT: NcBtDftManager: handleBtParam id = 11 09-17 13:28:21.128 2451 10051 D BtStatePassiveManager: handleBtStatePassive , apkName = com.app, apkAction = 4 09-17 13:28:21.129 2505 3091 I VoWifiQoe_N: ProcessReqInfo ul_msgid=5 09-17 13:28:21.129 2505 3091 I VoWifiQoe_N: processReqInfo MSG_WIFI_SIGNAL_INFO_IND 09-17 13:28:21.129 2505 3091 I VoWifiQoe_N: ProcessSignalInfoInd curStateIsIdle 0 09-17 13:28:21.129 2505 3091 I VoWifiQoe_N: ProcessSignalInfoInd wifiInterruptFlg 1 enScreenState 1 curStateIsIdle 0 09-17 13:28:21.129 2505 3091 I VoWifiQoe_N: UpdateEvaluatePolicy EVALUATE_POLICY_RSSI 09-17 13:28:21.129 2505 3091 I VoWifiQoe_N: UpdateEvaluatePolicy phoneId 1 is not qoe started! 09-17 13:28:21.129 2451 32551 D BT_CHR: BtChrManager: EventTask run 11 09-17 13:28:21.130 2247 2365 I PGServer: report state:8 event type:1 pid:0 uid:10225 pkg:null to pid: 1297 09-17 13:28:21.131 2247 2365 I BluetoothState: new active bluetooth uid: 10225, pid:15661, reason:BLE_SCAN 09-17 13:28:21.134 2451 10051 D Nc_Chr_BT: BtChrDataBaseManager: checkIfBTStatPassiveRcdExist read from:BtChrStatisticPassiveTable, get record: 1 09-17 13:28:21.137 2451 10051 D Nc_Chr_BT: BtChrDataBaseManager: updateBTStatPassiveRcd update suc, rowChg=1 09-17 13:28:21.137 2451 10051 D BtStatePassiveManager: btPassive save result is true 09-17 13:28:21.143 15661 15688 D libservice_armeabi-v7a.so: qt.bluetooth.android: QBluetoothDeviceDiscoveryAgentPrivate::start() - Low Energy search successfully started. 09-17 13:28:21.144 15661 15688 D libservice_armeabi-v7a.so: ######Scanning for devices... 09-17 13:28:21.200 15661 15661 E com.app:qt: No implementation found for void org.qtproject.qt5.android.bluetooth.QtBluetoothLE.leScanResult(long, android.bluetooth.BluetoothDevice, int, byte[]) (tried Java_org_qtproject_qt5_android_bluetooth_QtBluetoothLE_leScanResult and Java_org_qtproject_qt5_android_bluetooth_QtBluetoothLE_leScanResult__JLandroid_bluetooth_BluetoothDevice_2I_3B) 09-17 13:28:21.201 15661 15661 D AndroidRuntime: Shutting down VM 09-17 13:28:21.201 15661 15661 I QarthLog: [PatchStore] createDisableExceptionQarthFile 09-17 13:28:21.202 15661 15661 I QarthLog: [PatchStore] create disable file for com.app uid is 10225 09-17 13:28:21.208 15661 15661 E AndroidRuntime: FATAL EXCEPTION: main
<service android:name=".AppService" android:process=":qt"> <!-- android:process=":qt" is needed to force the service to run on a separate process than the Activity --> <!-- Application arguments --> <!-- Application arguments --> <!-- Application to launch --> <!-- Application to launch --> <!-- Deploy Qt libs as part of package --> <meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/> <!-- Deploy Qt libs as part of package --> <!-- Run with local libs --> <meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/> <meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/> <meta-data android:name="android.app.load_local_libs_resource_id" android:resource="@array/load_local_libs"/> <meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --:jar/QtPositioning.jar:jar/QtAndroidBluetooth.jar:jar/QtAndroidBearer.jar"/> <meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/> <!-- Run with local libs --> <!-- Messages maps --> <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/> <meta-data android:value="@string/unsupported_android_version" android:name="android.app.unsupported_android_version"/> <!-- Messages maps --> <!-- Background running --> <meta-data android:name="android.app.background_running" android:value="true"/> <!-- Background running --> <meta-data android:name="android.app.lib_name" android:value="service"/> </service> ... <!-- Background running --> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACTIVITY_RECOGNITION"/> <uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> <uses-permission android:name="android.permission.BLUETOOTH_SCAN"/> <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE"/> <uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/> <uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>
info:
Qt - 5.15.2
android-30it seems to me when it tries to start it doesn't find this method.
Can someone help me? thanks!!
-
wrote on 18 Sept 2021, 10:11 last edited by
I found the problem the AndroidManifest.xml missing the loaders of Qt libs :
<meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/> <meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/> <meta-data android:name="android.app.repository" android:value="default"/> <meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/> <meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
1/2