Important: Please read the Qt Code of Conduct -

Using Bluetooth with Qt 5.3.1 on Android crashes with "invalid indirect reference"

  • Hello,

    I just started doing a few tests using Bluetooth on an Android device. As soon as I try to use the Qt Bluetooth API the application will crash with the following info:

    @W/dalvikvm(23855): Invalid indirect reference 0x40ef24e8 in decodeIndirectRef
    E/dalvikvm(23855): VM aborting
    F/libc (23855): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1)@

    I'm using a Qt 5.3.1, Android 4.0.3 ABI: armeabi-v7a, HTC Sensation.

    Here is what try:

    @void TestBluetooth::start()

    QList<QBluetoothHostInfo> localAdapters;
    //when reaching this line the app crashes 
    localAdapters = QBluetoothLocalDevice::allDevices();


    The same happens if I run the availble Bluetooth Examples.

    Any ideas what the problem could be? Thanks!

  • Hello,

    It's working in my computer. I tried both my own application and example one. Which OS are you using in your computer? I tried in linux

  • try this for device connection:

    void TestBluetooth():: test ()

    QBluetoothDeviceDiscoveryAgent *qbd = new QBluetoothDeviceDiscovery(this)

    connect (qdb, SIGNAL (deviceDiscovered(QBluetoothDeviceInfo)),this,SLOT (testing(QBluetoothDeviceInfo)));

    void TestBluetooth()::testing (const QBluetoothDeviceInfo &dvc)

    qdebug() <<"device is:" <<;


  • Thanks optimusprime. I'm using linux also. When trying:

    @void TestBuetooth::start()

    QBluetoothDeviceDiscoveryAgent *qbd = new  QBluetoothDeviceDiscoveryAgent(this);
    connect(qbd,SIGNAL(deviceDiscovered(QBluetoothDeviceInfo)), this, SLOT(test(QBluetoothDeviceInfo)));
    qDebug() << "Starting discovery ...";
    //here it prints the message, that the device does not support bluetooth


    It reports, that the device does not support Bluetooth:

    @W/Qt (14722): qbluetoothdevicediscoveryagent_android.cpp:98 (void QBluetoothDeviceDiscoveryAgentPrivate::start()): Device does not support Bluetooth

    I'm wondering if the Android version 4.0.3 may be too old?

    I'm using JDK 1.8.0_05, android-ndk-r9d, android-sdk-linux-r23.0.2, AVD Target API 15

  • I think your problem is java version.
    you should use jdk 1.6 version or 1.7 .

    Try with 1.6 version, it should work.


    look over this document. This blog is posted by BogDan Vatra, one who make possible android app with Qt

  • No, that wasn't it either. I tried jdk 1.6 and 1.7 without luck :(. Anyway, thanks again for looking into this.

  • Report your issue to developer..

Log in to reply