Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Android development on MacOS with Qt Creator 4.9.2?

Android development on MacOS with Qt Creator 4.9.2?

Scheduled Pinned Locked Moved Solved General and Desktop
macosmacosxandroidandroid emulato
23 Posts 4 Posters 5.0k 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.
  • T ThanksForTheHelp

    I am on MacOS running Qt Creator 4.9.2 based on QT 5.12.4 (Clang 10) 64 bit. What I've installed. Everything besides JDK was installed using Android Studio.

    JDK 8u221 (using JDK 12 resulted in Qt Creator not finding SDK platform install)
    Android 9.+ (Q)
    Android SDK Build-Tools
    Android Emulator (29.0.11)
    Android SDK Platform-tools (29.0.1)
    Android SDK Tools (26.1.1)
    Intel x86 HAXM Install (7.5.1)
    NDK (20.0.5594570)
    

    I can create a x86_64 android stack example project without errors, but when I build and run the default project I get a pop-up window entitled "Select Android Device". There is only one device available and it is in the "incompatible" category.

    The error in this windows is: ABI is incompatible, device supports ABIs: x86. (OpenGL enabled)

    The issue: I cannot build and run android projects on x86_64 because there are no compatible devices. How do I solve this?

    Compiler Output

    Initializing deployment to Android device/simulator
    Error while building/deploying project untitled (kit: Android for x86_64 (Clang Qt 5.13.0 for Android x86_64))
    When executing step "Deploy to Android device"
    

    What I've tried: 'ANDROID_TARGET_ARCH=default/armeabi-v7a" in my project build settings. No difference.

    Edit: I followed the qt documentation and it clearly states You must download and install the latest Android NDK and SDK, hence why I downloaded the latest versions of SDK and NDK.

    J.HilkJ Online
    J.HilkJ Online
    J.Hilk
    Moderators
    wrote on last edited by
    #2

    Hi @thanksforthehelp and welcome

    Did you during Qt installation, select the correct precompiled Qt libs for android ? there should be 3, IIRC; armv7 armv8 and x86


    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


    Q: What's that?
    A: It's blue light.
    Q: What does it do?
    A: It turns blue.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      ThanksForTheHelp
      wrote on last edited by
      #3

      During the installation of Qt I selected EVERYTHING besides ios and Qt 3D, so my guess is Yes.

      J.HilkJ 1 Reply Last reply
      0
      • T ThanksForTheHelp

        During the installation of Qt I selected EVERYTHING besides ios and Qt 3D, so my guess is Yes.

        J.HilkJ Online
        J.HilkJ Online
        J.Hilk
        Moderators
        wrote on last edited by J.Hilk
        #4

        @thanksforthehelp
        you should reconsider this! that's like 50-60 gb of storages that may be largely unused.

        maybe it's better now, the Installer get an overhaul recently.

        anyway, on the rightleft side of QtCreator go into the BuildSettings page and enable /switch to the correct android kit that you need

        0_1564566418664_f0440c55-f3f2-41fe-b39c-721bde49038f-image.png


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          ThanksForTheHelp
          wrote on last edited by
          #5

          Well... I need x86_64 since I am going to develop my app for a Samsung Galaxy S10? Wouldn't switching kits to, for example armeabi-v7a, a problem?

          J.HilkJ 1 Reply Last reply
          0
          • T ThanksForTheHelp

            Well... I need x86_64 since I am going to develop my app for a Samsung Galaxy S10? Wouldn't switching kits to, for example armeabi-v7a, a problem?

            J.HilkJ Online
            J.HilkJ Online
            J.Hilk
            Moderators
            wrote on last edited by
            #6

            @thanksforthehelp are you sure its a 64 bit x86 architecture?

            Because as far as I know, those do not come precompiled, only the 32 bit one.

            So you would have to build Qt yourself for that one.


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            1 Reply Last reply
            0
            • T Offline
              T Offline
              ThanksForTheHelp
              wrote on last edited by
              #7

              From the looks of it on this website it seems as if Galaxy S10 and S10+ both have 64 bit processors. My guess is that I need x86_64 development for that. I can have x86 but wouldn't that be inefficient and sloppy?

              J.HilkJ jsulmJ 2 Replies Last reply
              0
              • T ThanksForTheHelp

                From the looks of it on this website it seems as if Galaxy S10 and S10+ both have 64 bit processors. My guess is that I need x86_64 development for that. I can have x86 but wouldn't that be inefficient and sloppy?

                J.HilkJ Online
                J.HilkJ Online
                J.Hilk
                Moderators
                wrote on last edited by
                #8

                @thanksforthehelp
                please check your device settings to make sure :)
                0_1564567437467_b2544a5b-778e-4767-a50f-e39506886df7-image.png

                I can have x86 but wouldn't that be inefficient and sloppy?

                32 bit apps run fine on 64 bit systems, in 90% of all cause you won't notice or measure a difference


                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                Q: What's that?
                A: It's blue light.
                Q: What does it do?
                A: It turns blue.

                1 Reply Last reply
                1
                • T ThanksForTheHelp

                  From the looks of it on this website it seems as if Galaxy S10 and S10+ both have 64 bit processors. My guess is that I need x86_64 development for that. I can have x86 but wouldn't that be inefficient and sloppy?

                  jsulmJ Online
                  jsulmJ Online
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #9

                  @thanksforthehelp said in Android development on MacOS with Qt Creator 4.9.2?:

                  My guess is that I need x86_64 development for that

                  No, Galaxy S10 and S10+ have ARM CPUs, not x86.
                  As @J-Hilk shows you need ARM64-v8a

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  1
                  • T Offline
                    T Offline
                    ThanksForTheHelp
                    wrote on last edited by
                    #10

                    Instruction Sets: arm64-v8a
                    Kernel Architecture: aarch64
                    CPU Architecture: ARMv8-A

                    Does that mean 32 bit? I sure as heck looks like 64 since it doesn't say 32

                    jsulmJ J.HilkJ 2 Replies Last reply
                    0
                    • T ThanksForTheHelp

                      Instruction Sets: arm64-v8a
                      Kernel Architecture: aarch64
                      CPU Architecture: ARMv8-A

                      Does that mean 32 bit? I sure as heck looks like 64 since it doesn't say 32

                      jsulmJ Online
                      jsulmJ Online
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by jsulm
                      #11

                      @thanksforthehelp CPU supports 64bit, but is able to execute 32bit as far as I know. Just like Windows/Linux on 64bit machines.

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • T Offline
                        T Offline
                        ThanksForTheHelp
                        wrote on last edited by
                        #12

                        I know 64 bit computer are able to execute and run 32 bit programs. The issue, as far as I can understand, is that 32 bit programs tend to be a bit slower since they do not utilise the whole CPU or something. Even if the difference is, for example, 90% performance I do not want 32 bit build because I need and want as fast, secure and stable as possible.

                        1 Reply Last reply
                        0
                        • T ThanksForTheHelp

                          Instruction Sets: arm64-v8a
                          Kernel Architecture: aarch64
                          CPU Architecture: ARMv8-A

                          Does that mean 32 bit? I sure as heck looks like 64 since it doesn't say 32

                          J.HilkJ Online
                          J.HilkJ Online
                          J.Hilk
                          Moderators
                          wrote on last edited by
                          #13

                          @thanksforthehelp
                          well there you have it, select your Qt for Android ARM64-v8a kit
                          and you should be good to go


                          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                          Q: What's that?
                          A: It's blue light.
                          Q: What does it do?
                          A: It turns blue.

                          1 Reply Last reply
                          0
                          • T Offline
                            T Offline
                            ThanksForTheHelp
                            wrote on last edited by
                            #14

                            I managed to solve the initial error:

                            Initializing deployment to Android device/simulator
                            Error while building/deploying project untitled (kit: Android for x86_64 (Clang Qt 5.13.0 for Android x86_64))
                            When executing step "Deploy to Android device"```
                            
                            by opening Android Studio -> SDK Manger -> Tick Show Package Details -> Install Android 9.+ (Q) with Atom_64 -> apply -> install.
                            
                            Now when I compile a Google Pixel 2 XL pops up when I run but no app is created. There are errors in the 'Issues' tab:
                            

                            :-1: error: error: cannot find -lc++
                            :-1: error: linker command failed with exit code 1 (use -v to see invocation)

                            J.HilkJ 1 Reply Last reply
                            0
                            • T Offline
                              T Offline
                              ThanksForTheHelp
                              wrote on last edited by ThanksForTheHelp
                              #15

                              Selecting Qt for Android ARM64-v8a does not compile. There are no supported ABIs for that on my computer nor in the SDK manager...

                              Edit: Entering the AVD Manager and changing the architecture of my default phone emulator mirror/profile on other images ATM to nougat 25 for arm64-v8a target build android 7.1.1, despite me having android 9.0, lets try it out

                              1 Reply Last reply
                              0
                              • T ThanksForTheHelp

                                I managed to solve the initial error:

                                Initializing deployment to Android device/simulator
                                Error while building/deploying project untitled (kit: Android for x86_64 (Clang Qt 5.13.0 for Android x86_64))
                                When executing step "Deploy to Android device"```
                                
                                by opening Android Studio -> SDK Manger -> Tick Show Package Details -> Install Android 9.+ (Q) with Atom_64 -> apply -> install.
                                
                                Now when I compile a Google Pixel 2 XL pops up when I run but no app is created. There are errors in the 'Issues' tab:
                                

                                :-1: error: error: cannot find -lc++
                                :-1: error: linker command failed with exit code 1 (use -v to see invocation)

                                J.HilkJ Online
                                J.HilkJ Online
                                J.Hilk
                                Moderators
                                wrote on last edited by
                                #16

                                ah @thanksforthehelp different error :) would have been good to know from the beginning x)

                                take a look here
                                https://forum.qt.io/topic/103713/error-cannot-find-lc-qt-5-12-android

                                error comes from the ndk 20 despite what the docs says, that isn't quite without issues. But fixable, like the thread describes.


                                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                                Q: What's that?
                                A: It's blue light.
                                Q: What does it do?
                                A: It turns blue.

                                1 Reply Last reply
                                1
                                • T Offline
                                  T Offline
                                  ThanksForTheHelp
                                  wrote on last edited by
                                  #17

                                  It is still trying to boot the first emulation on the new architecture. I get a warning though: "Running a x86 based AVD is 10x faster". It is still trying to boot it after 5 minutes...

                                  jsulmJ 1 Reply Last reply
                                  0
                                  • T ThanksForTheHelp

                                    It is still trying to boot the first emulation on the new architecture. I get a warning though: "Running a x86 based AVD is 10x faster". It is still trying to boot it after 5 minutes...

                                    jsulmJ Online
                                    jsulmJ Online
                                    jsulm
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #18

                                    @thanksforthehelp said in Android development on MacOS with Qt Creator 4.9.2?:

                                    "Running a x86 based AVD is 10x faster"

                                    Yes, for testing in VM on PC it is better to use x86 based AVD as it is way slower to emulate complete different CPU (ARM on x86).

                                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    1 Reply Last reply
                                    0
                                    • T Offline
                                      T Offline
                                      ThanksForTheHelp
                                      wrote on last edited by
                                      #19

                                      @jsulm so I should deploy for x86 but then when I have my prototype complete I build it with arm? Should the final product, besides the binary files, work the same and be the same?

                                      jsulmJ 1 Reply Last reply
                                      0
                                      • T ThanksForTheHelp

                                        @jsulm so I should deploy for x86 but then when I have my prototype complete I build it with arm? Should the final product, besides the binary files, work the same and be the same?

                                        jsulmJ Online
                                        jsulmJ Online
                                        jsulm
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #20

                                        @thanksforthehelp Yes, exactly. But you should still test on a ARM based phone/emulator sometimes :-)

                                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                                        1 Reply Last reply
                                        1
                                        • T Offline
                                          T Offline
                                          ThanksForTheHelp
                                          wrote on last edited by
                                          #21

                                          After switching to x86 and applying the fix to remove the new compiler errors mentioned above I get a fully running emulation of android. When does my program actually boot? Have selected android x86 project, stacked, but nothing happens after the phone boots up...

                                          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