gluonhq / gluon-samples

Gluon sample projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Beacons sample transmits but doesn't scan on my phones.

macgibbon opened this issue · comments

I am seeing the same behavior on Android and Iphone. Would it be possible to provide release bundles as was done on [hello gluon ci project] (https://github.com/gluonhq/hello-gluon-ci/releases/tag/0.0.1)?

That would make it easier to distinguish between changes in hardware vs the development tools.

I suspect additional permissions are required, in particular, android.permission.BLUETOOTH_SCAN.

com.gluonhq.samples.beacons          I  BluetoothAdapter() : com.gluonhq.samples.beacons
2023-03-06 12:55:40.403 16426-16465 BluetoothAdapter        com.gluonhq.samples.beacons          I  STATE_ON
2023-03-06 12:55:40.807  1211-3911  vendor.qti...bs_handler and...are.bluetooth@1.0-service-qti  I  ProcessIbsCmd: Received IBS_WAKE_IND: 0xFD
2023-03-06 12:55:40.807  1211-3911  vendor.qti...bs_handler and...are.bluetooth@1.0-service-qti  D  SerialClockVote: vote for UART CLK ON
2023-03-06 12:55:40.808  1211-3911  vendor.qti...-wake_lock and...are.bluetooth@1.0-service-qti  D  Acquire wakelock is acquired 
2023-03-06 12:55:40.808  1211-3911  vendor.qti...bs_handler and...are.bluetooth@1.0-service-qti  I  ProcessIbsCmd: Writing IBS_WAKE_ACK
2023-03-06 12:55:40.888  1211-3911  vendor.qti...bs_handler and...are.bluetooth@1.0-service-qti  I  ProcessIbsCmd: Received IBS_SLEEP_IND: 0xFE
2023-03-06 12:55:40.888  1211-3911  vendor.qti...bs_handler and...are.bluetooth@1.0-service-qti  D  SerialClockVote: vote for UART CLK OFF
2023-03-06 12:55:41.039  1211-3531  vendor.qti...-wake_lock and...are.bluetooth@1.0-service-qti  D  Release wakelock is released 
2023-03-06 12:55:41.299 16426-16465 BluetoothAdapter        com.gluonhq.samples.beacons          I  STATE_ON
2023-03-06 12:55:41.299 16426-16465 BluetoothAdapter        com.gluonhq.samples.beacons          I  STATE_ON
2023-03-06 12:55:41.300 16426-16465 BluetoothAdapter        com.gluonhq.samples.beacons          I  STATE_ON
2023-03-06 12:55:41.301 16426-16465 BluetoothLeScanner      com.gluonhq.samples.beacons          D  Start Scan with callback
2023-03-06 12:55:42.657  1211-3911  vendor.qti...bs_handler and...are.bluetooth@1.0-service-qti  I  ProcessIbsCmd: Received IBS_WAKE_IND: 0xFD
2023-03-06 12:55:42.657  1211-3911  vendor.qti...bs_handler and...are.bluetooth@1.0-service-qti  D  SerialClockVote: vote for UART CLK ON
2023-03-06 12:55:42.658  1211-3911  vendor.qti...-wake_lock and...are.bluetooth@1.0-service-qti  D  Acquire wakelock is acquired 
2023-03-06 12:55:42.658  1211-3911  vendor.qti...bs_handler and...are.bluetooth@1.0-service-qti  I  ProcessIbsCmd: Writing IBS_WAKE_ACK
2023-03-06 12:55:42.742  1211-3911  vendor.qti...bs_handler and...are.bluetooth@1.0-service-qti  I  ProcessIbsCmd: Received IBS_SLEEP_IND: 0xFE
2023-03-06 12:55:42.743  1211-3911  vendor.qti...bs_handler and...are.bluetooth@1.0-service-qti  D  SerialClockVote: vote for UART CLK OFF
2023-03-06 12:55:42.893  1211-3531  vendor.qti...-wake_lock and...are.bluetooth@1.0-service-qti  D  Release wakelock is released 
**2023-03-06 12:55:43.368 16426-16465 samples.beacons         com.gluonhq.samples.beacons          A  java_vm_ext.cc:594] JNI DETECTED ERROR IN APPLICATION: JNI CallVoidMethod called with pending exception java.lang.SecurityException: Need android.permission.BLUETOOTH_SCAN permission for AttributionSource { uid = 10461, packageName = com.gluonhq.samples.beacons, attributionTag = null, token = android.os.BinderProxy@7b658ed, next = null }: GattService registerScanner
                                                                                                    java_vm_ext.cc:594] (Throwable with no stack trace)
                                                                                                    java_vm_ext.cc:594] 
                                                                                                    java_vm_ext.cc:594]     in call to CallVoidMethod**
2023-03-06 12:55:44.504  1211-3911  vendor.qti...bs_handler and...are.bluetooth@1.0-service-qti  I  ProcessIbsCmd: Received IBS_WAKE_IND: 0xFD
2023-03-06 12:55:44.504  1211-3911  vendor.qti...bs_handler and...are.bluetooth@1.0-service-qti  D  SerialClockVote: vote for UART CLK ON

@macgibbon Attach 4.0.18-SNAPSHOT has a possible fix for this issue (based on your PR). Can you test it adding:

<repositories>
        <repository>
            <id>Snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </repository>
    </repositories>

to your pom?