Skip to first unread message
Assigned to ewpa...@gmail.com by me

hello

unread,
Sep 7, 2017, 12:50:24 PM9/7/17
to mitappinv...@googlegroups.com
How to solve this problem ?

Attempt to invoke virtual method 'void android.bluetooth.le.BluetoothLeScanner.startScan(java.util.List, android.bluetooth.le.ScanSettings, android.bluetooth.le.ScanCallback)' on a null object reference<br/><i>Note:</i>&nbsp;You will not see another error reported for 5 seconds.





Abraham Getzler

unread,
Sep 7, 2017, 2:41:16 PM9/7/17
to MIT App Inventor Forum
blocks?
ABG

Evan Patton

unread,
Sep 7, 2017, 3:25:35 PM9/7/17
to MIT App Inventor Forum
A couple possible causes:

1) You may need to reconnect the companion if you have added the BLE extension after connecting the companion.
2) You need Android version 5.0 or higher, so you will get this message on earlier versions of Android.
3) Bluetooth is turned off or permission to use Bluetooth may have been revoked from the MIT App Inventor companion (only on certain builds of Android).

Evan

hello

unread,
Sep 7, 2017, 11:34:36 PM9/7/17
to mitappinv...@googlegroups.com
Thanks Evan !

My Android version is 5.0.2.
Although the BLE function still can use, but always pop-up the message.

Message has been deleted

Gennaro Filomene

unread,
Sep 15, 2017, 10:45:36 AM9/15/17
to mitappinv...@googlegroups.com
Ciao,
da quello che vedo, non hai inserito nessun blocco che ti indichi che il dispositivo è stato trovato. Prova ad inserire un listpicker e di farlo popolare con i dispositivi trovati. Dopo aver avuto evidenza che la scansione è terminata correttamente (trovando il tuo dispositivo) provi ad collegarti ad esso. Ricorda: la connessione con i dispositivi BLE potrebbe durare poco se è già associata ed accoppiata con altre app, in tal caso si disconnette ripetutamente.

Hello,
from what I see, you did not insert any block that indicates that the device was found. Try inserting a listpicker and making it popular with the devices found. After you have found that the scan is finished correctly (finding your device) try to connect to it. Remember: Connecting to BLE devices may not last long if it's already associated and paired with other apps, then disconnects repeatedly.

Evan Patton

unread,
Sep 15, 2017, 1:12:52 PM9/15/17
to MIT App Inventor Forum
Can you verify that your device has BluetoothLE? There is call prior to where your crash occurs to getBluetoothLeScanner(), which is returning null. That leads to the error you originally posted. The fact that Android is not returning a scanner object suggests to me that either Bluetooth is turned off or that BLE scanning isn't supported by the hardware/software combination.

Evan

Reply all
Reply to author
Forward
0 new messages