Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Using Bluetooth with Qt 5.3.1 on Android crashes with "invalid indirect reference"
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 2 Posters 2.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    micha-
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0
    • O Offline
      O Offline
      optimusprime
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • O Offline
        O Offline
        optimusprime
        wrote on last edited by
        #3

        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:" <<dvc.name();

        }

        1 Reply Last reply
        0
        • M Offline
          M Offline
          micha-
          wrote on last edited by
          #4

          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
          qbd->start();
          

          }@

          It reports, that the device does not support Bluetooth:

          @W/Qt (14722): qbluetoothdevicediscoveryagent_android.cpp:98 (void QBluetoothDeviceDiscoveryAgentPrivate::start()): qt.bluetooth.android: 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

          1 Reply Last reply
          0
          • O Offline
            O Offline
            optimusprime
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • O Offline
              O Offline
              optimusprime
              wrote on last edited by
              #6

              http://www.kdab.com/qt-on-android-episode-2/

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

              1 Reply Last reply
              0
              • M Offline
                M Offline
                micha-
                wrote on last edited by
                #7

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

                1 Reply Last reply
                0
                • O Offline
                  O Offline
                  optimusprime
                  wrote on last edited by
                  #8

                  Report your issue to developer..

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved