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. Deploying to Android from QtCreator under mac osx
QtWS25 Last Chance

Deploying to Android from QtCreator under mac osx

Scheduled Pinned Locked Moved Mobile and Embedded
androidqtcreatormac os x
14 Posts 4 Posters 7.9k 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.
  • B Offline
    B Offline
    boggins
    wrote on last edited by boggins
    #1

    I am having trouble deploying an android app to device (or emulator), from mac osx.
    Max osx 10.8, QtCreator 3.4.2, Qt 5.5, deploying to Nexus 7 running android 4.4.

    As far as I am aware I have set up the environment suitably - SDK, NDK, ant, and java are all installed and referred to in Preferences->Android
    ./adb devices displays device OK.
    The app builds ok, and an .apk file is created. I can transfer this apk to the device (e.g. via dropbox) and it installs and runs as expected.

    But I cannot deploy and run it via QtCreator. When I attempt to run, I get the message "unable to start <appname>" in the Application Output window. The same is true of an auto-generated hello world app - builds ok, but I get 'unable to start "qt.org.example"'.

    The green dot (over the android symbol at lower left) is visible on QtCreator, regardless of whether I have an android device connected.

    On Linux I was able to get the same app running via QtCreator, but if I recall correctly (I do not have access to my linux system at the moment), after I pressed the green run arrow, a dialog opened giving me a choice of device to deploy to - I don't see this under mac osx, but I do see it when I select "Clean temporary libraries on device" from the Project->Run settings->Deploy configurations.

    Is there something else I need to set up here? Something adb-related? Thanks.

    1 Reply Last reply
    0
    • R Offline
      R Offline
      RockAndCode
      wrote on last edited by
      #2

      Did you add the kit (in your case, the android device) in Qtcreator?

      B 1 Reply Last reply
      0
      • R RockAndCode

        Did you add the kit (in your case, the android device) in Qtcreator?

        B Offline
        B Offline
        boggins
        wrote on last edited by
        #3

        @Roshni Yes I have added an android kit. As I indicated, I am able to build an apk successfully.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Did you try with the "Use gradle instead of Ant" option ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          B 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            Did you try with the "Use gradle instead of Ant" option ?

            B Offline
            B Offline
            boggins
            wrote on last edited by
            #5

            @SGaist Yes, tried gradle as well :)

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              What version of the Android SDK and NDK are you using ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • B Offline
                B Offline
                boggins
                wrote on last edited by
                #7

                I am using r10e of the NDK, and 24.3.3 of the SDK. I just downloaded them last week, I believe they are the latest versions available.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Maybe a silly question but, do you have java installed properly ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  B 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Maybe a silly question but, do you have java installed properly ?

                    B Offline
                    B Offline
                    boggins
                    wrote on last edited by
                    #9

                    @SGaist Well it depends what you mean by properly ;)

                    In QtCreator I am referencing Java here:
                    /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

                    (in Preferences->Android)

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      That looks good…

                      Did you set the API level of your application to the same or a lower version corresponding to your device ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      B 1 Reply Last reply
                      0
                      • SGaistS SGaist

                        That looks good…

                        Did you set the API level of your application to the same or a lower version corresponding to your device ?

                        B Offline
                        B Offline
                        boggins
                        wrote on last edited by
                        #11

                        @SGaist Yes I believe so. I've installed API 19 from the SDK manager, and I'm referring to API 19 under Projects->BuildAndroidAPK.

                        My device runs Android 4.4.4, which according to this:
                        https://en.wikipedia.org/wiki/Android_version_history
                        uses API 19.

                        I've also just installed the latest and greatest Java JDK just incase anything was wrong there - 1.8.0_51 - and I've updated the path in the preferences accordingly. (The path by the way is a little different from that required for 1.6 - it's now in /Library/Java.... whereas before it was /System/Library/Java...)

                        But I wonder is the problem more the detection of the android device - the fact that it's always showing a green dot (even when my tablet is not connected) is strange. And under Preferences->Devices it tells me that the android device is "ready to use" even if there's no device there.

                        The problem is less pressing for me now as I'm back home and have access to my linux system, but it would still be nice to know what's going wrong on mac osx.

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          What do you get if you call adb devices -l ?

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • M Offline
                            M Offline
                            mkdh
                            wrote on last edited by
                            #13

                            https://m.youtube.com/watch?v=WFGRr0DV3oM

                            This is a demo video for deploying each different platform.

                            Check what the different with your operate.
                            And don't forget to rebuild your project.

                            Maybe you can connect with your android.
                            Just try it.

                            1 Reply Last reply
                            0
                            • B Offline
                              B Offline
                              boggins
                              wrote on last edited by boggins
                              #14

                              Sorry for the delay in replying to your suggestions. I am travelling again in the holiday season, and so I'm again trying to use my macbook to develop Android apps.

                              When I run ./adb devices -l, I see the device(s) OK - for example with my Nexus 7 tablet I see:

                              List of devices attached 
                              <some sort of device id>       device usb:24100000 product:nakasi model:Nexus_7 device:grouper
                              

                              Similarly if I have an emulator running, I see the emulator listed.

                              Regarding the video, thanks, but I don't see anything that I'm doing differently, except of course that I have more recent versions of Qt, Android SDK, android NDK, java etc than in the video. Interestingly in the video, you can see the author also sees "unable to start <appname> " (as I do) in the application output window, but the app starts for him.

                              A recent query here by a user targetting iOS had issues deploying apps with QtCreator 3.5 which were resolved by using QtCreator 3.6 - I have just updated to 3.6 but I experience the same problems as before.

                              Thanks for any suggestions.

                              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