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. [SOLVED] Qt creator won't detect my android device

[SOLVED] Qt creator won't detect my android device

Scheduled Pinned Locked Moved Mobile and Embedded
19 Posts 5 Posters 20.6k Views
  • 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.
  • L Offline
    L Offline
    lgb3
    wrote on last edited by
    #1

    Hi,

    I'm trying to start developing for Android using the Qt toolkit, but I'm stuck in the stage of deploying the application to the device (I'm following the tutorial at http://qt-project.org/doc/qtcreator-2.8/creator-android-app-tutorial.html).

    My setup is :
    Ubuntu
    Qt Creator 2.8.1
    Qt 5.1.1 for Android armv7
    Android device : Samsung Galaxy Y running Android 2.3.5

    USB Debuggin is already enabled on my device, and "adb" detects it is connected. I can also send/receive files to/from the device via USB. I'm targeting an application at API level 10, and deploying to device is the default action.

    After trying to run I'm gettin the following error, and a dialog for choosing an AVD is popped:
    bq. 19:21:21: Please wait, searching for a suitable device for target:android-10.
    Error while building/deploying project accelbubble (kit: Android for arm (GCC 4.8, Qt 5.1.1))
    When executing step 'Deploy to Android device'

    Can anybody help me figure what the problem may be?
    Thanks in advance,
    Luiz.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgb3
      wrote on last edited by
      #2

      Hi, sorry to insist, but I really need to get this to work, so I can do a work for school.

      I have also followed the steps at http://qt-project.org/wiki/How-to-debug-Qt-applications-on-Android-device and http://developer.android.com/tools/device.html , but it still pops the AVD Manager when I try to Run the application on my device.

      Doesn't anyone really have any idea on how to track the problem?

      1 Reply Last reply
      0
      • p3c0P Offline
        p3c0P Offline
        p3c0
        Moderators
        wrote on last edited by
        #3

        Hi,

        Has the APK for your application created when you compile and deploy ?
        Check it in directory android > bin.
        You can manually copy this APK onto your phone and install it.

        157

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

          It looks like he defined an android api in the project that is higher than the api on his device.

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lgb3
            wrote on last edited by
            #5

            Hi,

            Thank you for your replies!

            Moster : I'm targeting an Android API Level 10, which accordingly to (http://developer.android.com/about/versions/android-2.3.3.html) matches an Android version 2.3.3. The version running on my phone is 2.3.5 .

            p3c0 : It would be great if I could at least copy the release kit to my phone and install it there manually, but the directory you pointed out is empty. Could it be that the fail is actually at the build stage and QtCretor is no reporting it?

            1 Reply Last reply
            0
            • p3c0P Offline
              p3c0P Offline
              p3c0
              Moderators
              wrote on last edited by
              #6

              The application is getting compiled but the APK is not getting built.
              Since you have ubuntu, can you just goto "Your Android SDK dir" > sdk > tools, there you will see tool named "android". Just execute it and it will display the SDK's and system images for your target API. Check if those been installed for your target viz. 2.3.3.
              If possible can you post the screenshot of it ?

              157

              1 Reply Last reply
              0
              • L Offline
                L Offline
                lgb3
                wrote on last edited by
                #7

                The only System Image that is listed there is one for Intel x86 Atom. But it wasn't installed :

                !http://oi43.tinypic.com/2336td.jpg(SS1)!

                Later I installed it, but the .apk still wasn't generated. Any ideas on what this might be?

                1 Reply Last reply
                0
                • p3c0P Offline
                  p3c0P Offline
                  p3c0
                  Moderators
                  wrote on last edited by
                  #8

                  Now im to quite unsure what the problem could be. But can you try to compile for target api 18 to check atleast for it the apk is created ?

                  157

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    lgb3
                    wrote on last edited by
                    #9

                    I did it, but I found no "bin" directory under my project dir/android. Would there be a reason for Qt Creator not being creating the APK?

                    1 Reply Last reply
                    0
                    • p3c0P Offline
                      p3c0P Offline
                      p3c0
                      Moderators
                      wrote on last edited by
                      #10

                      Hi,

                      bin directory will be created when you deploy the application. Was the deploy process initiated for target api 18 ?

                      157

                      1 Reply Last reply
                      0
                      • L Offline
                        L Offline
                        lgb3
                        wrote on last edited by
                        #11

                        For API Level 18, exactly the same thing happens:

                        The same error message of "Android device not found" (which was already expected, since there was no device connected indeed), AVD Manager os popped, and there is not the creation of a /bin directory under /android for my project.

                        I guess my ultimate trial would be to try with Qt 5.2 Alpha. Is there a way to report this bug to Qt?

                        1 Reply Last reply
                        0
                        • p3c0P Offline
                          p3c0P Offline
                          p3c0
                          Moderators
                          wrote on last edited by
                          #12

                          Can you paste the whole compile output and deploy output here for target API 18 ? Will check it for last time.
                          Also can get the screenshot of "Tools > Options > Android" window and paste here.

                          157

                          1 Reply Last reply
                          0
                          • L Offline
                            L Offline
                            lgb3
                            wrote on last edited by
                            #13

                            This is the compile output :
                            @20:47:10: Running steps for project accelbubble...
                            20:47:10: Configuration unchanged, skipping qmake step.
                            20:47:10: Starting: "/usr/bin/make"
                            /home/guilhermebrant/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -c -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -std=gnu++0x -g -g -marm -O0 -fno-omit-frame-pointer -Wall -Wno-psabi -W -D_REENTRANT -fPIE -DQT_NO_PRINTDIALOG -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_QUICK_LIB -DQT_SVG_LIB -DQT_QML_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -DQT_SENSORS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../Qt/5.1.1/android_armv7/mkspecs/android-g++ -I../accelbubble -I../../../Qt/5.1.1/android_armv7/include -I../../../Qt/5.1.1/android_armv7/include/QtQuick -I../../../Qt/5.1.1/android_armv7/include/QtSvg -I../../../Qt/5.1.1/android_armv7/include/QtQml -I../../../Qt/5.1.1/android_armv7/include/QtWidgets -I../../../Qt/5.1.1/android_armv7/include/QtXml -I../../../Qt/5.1.1/android_armv7/include/QtSensors -I../../../Qt/5.1.1/android_armv7/include/QtNetwork -I../../../Qt/5.1.1/android_armv7/include/QtGui -I../../../Qt/5.1.1/android_armv7/include/QtCore -I. -I../../../android-ndk-r9/sources/cxx-stl/gnu-libstdc++/4.6/include -I../../../android-ndk-r9/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include -I../../../android-ndk-r9/platforms/android-9/arch-arm/usr/include -I. -o main.o ../accelbubble/main.cpp
                            /home/guilhermebrant/Qt/5.1.1/android_armv7/bin/rcc -name accelbubble ../accelbubble/accelbubble.qrc -o qrc_accelbubble.cpp
                            /home/guilhermebrant/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -c -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -std=gnu++0x -g -g -marm -O0 -fno-omit-frame-pointer -Wall -Wno-psabi -W -D_REENTRANT -fPIE -DQT_NO_PRINTDIALOG -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_QUICK_LIB -DQT_SVG_LIB -DQT_QML_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -DQT_SENSORS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../Qt/5.1.1/android_armv7/mkspecs/android-g++ -I../accelbubble -I../../../Qt/5.1.1/android_armv7/include -I../../../Qt/5.1.1/android_armv7/include/QtQuick -I../../../Qt/5.1.1/android_armv7/include/QtSvg -I../../../Qt/5.1.1/android_armv7/include/QtQml -I../../../Qt/5.1.1/android_armv7/include/QtWidgets -I../../../Qt/5.1.1/android_armv7/include/QtXml -I../../../Qt/5.1.1/android_armv7/include/QtSensors -I../../../Qt/5.1.1/android_armv7/include/QtNetwork -I../../../Qt/5.1.1/android_armv7/include/QtGui -I../../../Qt/5.1.1/android_armv7/include/QtCore -I. -I../../../android-ndk-r9/sources/cxx-stl/gnu-libstdc++/4.6/include -I../../../android-ndk-r9/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include -I../../../android-ndk-r9/platforms/android-9/arch-arm/usr/include -I. -o qrc_accelbubble.o qrc_accelbubble.cpp
                            /home/guilhermebrant/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ --sysroot=/home/guilhermebrant/android-ndk-r9/platforms/android-9/arch-arm/ -Wl,-soname,libaccelbubble.so -Wl,-rpath=/data/bamboo/xml-data/build-dir/DQTC-LGPLRELEASEBUILD510-LGPLANDROIDLINUXX64510ARMV7/PADDING/lib -Wl,-rpath-link=/home/guilhermebrant/Qt/5.1.1/android_armv7/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libaccelbubble.so main.o qrc_accelbubble.o -L/home/guilhermebrant/android-ndk-r9/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a -L/home/guilhermebrant/android-ndk-r9/platforms/android-9/arch-arm//usr/lib -L/home/guilhermebrant/Qt/5.1.1/android_armv7/lib -lQt5Quick -L/opt/android/ndk/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a -L/opt/android/ndk/platforms/android-9/arch-arm//usr/lib -lQt5Svg -lQt5Qml -lQt5Widgets -lQt5Xml -lQt5Sensors -lQt5Network -lQt5Gui -lQt5Core -lgnustl_shared -lsupc++ -llog -lz -lm -ldl -lc -lgcc -lGLESv2
                            20:47:14: The process "/usr/bin/make" exited normally.
                            20:47:14: Elapsed time: 00:04.@

                            I just noticed something I haven't noticed before. It's under the "General Messages" tab:
                            @Could not read qmake configuration file /home/guilhermebrant/Qt/5.1.1/android_armv7/mkspecs/android-g++/qmake.conf.@

                            This is how the settings under Android look like :

                            !http://oi39.tinypic.com/2092f6p.jpg(Android settings)!

                            Is there anything you find relevant there?

                            1 Reply Last reply
                            0
                            • p3c0P Offline
                              p3c0P Offline
                              p3c0
                              Moderators
                              wrote on last edited by
                              #14

                              Hi,
                              From the screenshot i see you are using 64 bit Ubuntu, so
                              Can you go into "android-sdk-linux > sdk > tools" and make sure the 64 emulator version is executing ?
                              (By Default adb executes "emulator" and it is 32 bit so just rename "emulator" to something else and rename "emulator64-arm" to "emulator". This make sure that the 64 bit arm emulator will run on deploy)

                              Hope this helps.

                              157

                              B 1 Reply Last reply
                              1
                              • L Offline
                                L Offline
                                lgb3
                                wrote on last edited by
                                #15

                                Well, this also didn't work. I'm gonna try Qt 5.2 and see if I get any results. I hope I can. Thank you very much for your help anyways, p3c0.

                                1 Reply Last reply
                                0
                                • p3c0P Offline
                                  p3c0P Offline
                                  p3c0
                                  Moderators
                                  wrote on last edited by
                                  #16

                                  Ok. No problem :). BTW, Qt 5.2 beta is supposed to be released today as per their schedule. May be you could try with it.

                                  157

                                  1 Reply Last reply
                                  0
                                  • P Offline
                                    P Offline
                                    Pierrot
                                    wrote on last edited by
                                    #17

                                    Hello,
                                    any news on this topic ?
                                    I experiment the same problem with Ubuntu 13.10 (run on Windows with vmWare) + Qt5.2 Beta 1 (official + all snapshots since Beta1) + several different recent Android devices. The device is seen ('adb devices' shows the device), the build in Qt Creator is OK, but when trying to deploy I cannot see the device. On the same computer, with Qt Creator on Windows the device appears when deploying and it can be run on device.

                                    1 Reply Last reply
                                    0
                                    • L Offline
                                      L Offline
                                      lgb3
                                      wrote on last edited by
                                      #18

                                      I've been able to deploy to an Android device of API Level 16, but not for Level 10.

                                      The problem was that my project name contained a dash in its name (like hello-world, for instance). When generating the Java files to deploy for Android, Qt creates a package with the name of the project in it. This generates a compilation error, because dash is not allowed character in a Java Package name, but the error is not that transparent because it is in a Qt internal file. This bug should be resolved by Qt.

                                      It still doesn't work for API Level 10, however, neither on real device nor on an emulator.

                                      1 Reply Last reply
                                      0
                                      • p3c0P p3c0

                                        Hi,
                                        From the screenshot i see you are using 64 bit Ubuntu, so
                                        Can you go into "android-sdk-linux > sdk > tools" and make sure the 64 emulator version is executing ?
                                        (By Default adb executes "emulator" and it is 32 bit so just rename "emulator" to something else and rename "emulator64-arm" to "emulator". This make sure that the 64 bit arm emulator will run on deploy)

                                        Hope this helps.

                                        B Offline
                                        B Offline
                                        Bigmat
                                        wrote on last edited by
                                        #19

                                        @p3c0 thank you :-) your post save my day !

                                        Qt/C++ and Android 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