Show runtime error when BLE click scan

Hi All,

I'm developing with Andorid12 and I don't have any foundation.

I would like to ask what is the reason for this error when I scan with reference to other people's examples?

Hello kai - welcome to the forum!

It seems that, the new version App Inventor nb190 does not add the "ACCESS_FINE_LOCATION" permission automatically. Try:

Snap3

Show your (relevant) blocks and post the aia (or better a simple test aia).

(added to FAQ)

Hi ChrisWard,

Here I need to add?

This is my reference project
Android10BLETest_copy.aia (186.6 KB)

Hi Anke,

This is my reference project
Android10BLETest_copy.aia (186.6 KB)

Hi ABG,

Which one is something I can refer to, I have no idea

Hi ChrisWard,

I try it,but it still fail.
image

These 2 permissions are NOT declared in the Manifest:

If I declare them in the Manifest and build the APK, it works fine.

See also here.
@ewpatton

Hi Anke,

Thanks a lot,but how can I declared them?

Can you teach me?

Pardon me, I mistyped the required permission in my FAQ post. It should be
ACCESS_FINE_LOCATION

Note the underscores, and the all CAPS.

Hi kai

Here is an example Project:

BLE_RECEIVE_3_INTEGERS.aia (192.4 KB)

... because there are more Blocks to use, sorry - I have uploaded an example Project.

Hi again

Your test Project is not using the latest version of the BLE extension:

On my site:
https://www.professorcad.co.uk/appinventortips#TipsBluetooth


hãy cho tôi một cách khắc phục


Tôi đã thử với chính dự án của bạn và vấn đề đã xảy ra trên chính dự án của bạn ( bạn đã cập nhật lại app MIT AI2 Companion trên điện thoại của bạn chứ ?)

Did you update the Companion app (2.65 or 2.65u)?

Both permissions are declared in the Companion app (2.65 or 2.65u).

I'm using the latest version 2.65 and confirm this issue for the companion app... I'm currently in the process of updating my bluetooth extension...

Taifun

1 Like

We can't see what else you may have or how the logic of your process flows, which makes a difference to the advice given. However, we have established that you may need to request 3 Bluetooth permissions - are you using the BLE extension? See my post #12.

Here is a way to request multiple permissions:
RequestMultiplePermissions.aia (188.3 KB)