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. Android app compilation on MAC - Wrong toolchain ?
Forum Updated to NodeBB v4.3 + New Features

Android app compilation on MAC - Wrong toolchain ?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
7 Posts 3 Posters 692 Views 2 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.
  • D Offline
    D Offline
    dROb
    wrote on 30 Dec 2019, 14:45 last edited by dROb
    #1

    Hello All! I feel like my question might be silly but so far I reached the limits of my knowledge for the Build Environments.

    I've got Mac with Android Studio, SDK, and NDK installed. Just trying to test simple examples (btchat)
    Building the desktop app works flawlessly, but when trying to compile the Android ARM or x86 App, I get such messages:

        /bin/sh: /Users/drob/Library/Android/sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-g++: No such file or directory
        /bin/sh: /Users/drob/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++: No such file or directory
        /bin/sh: /Users/drob/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++: No such file or directory
        Project ERROR: Cannot run target compiler '/Users/drob/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++'. Output:
        ===================
        /bin/sh: /Users/drob/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++: No such file or directory
        ===================
        Maybe you forgot to setup the environment?
        Error while parsing file /Users/drob/OneDrive/DEVEL/PROJECTS/QT_Projects/btchat/btchat.pro. Giving up.
    
    

    I also got this message in the Issues tab of QT Creator:

    :-1: warning: "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" is used by qmake, but "/Users/drob/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++" is configured in the kit.
    Please update your kit (Android for x86 (Clang Qt 5.9.9 for Android x86)) or choose a mkspec for qmake that matches your target environment better.
    

    I feel like the Toolchain / Build environment is not configured right, but how to fix this appropriately?
    I also have XCode installed, and I read that QT might use its Clang from XCode? But how di I tell QT to do so?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 30 Dec 2019, 16:49 last edited by
      #2

      Hi and welcome to devnet,

      What version of Qt are you using ?
      What version of the NDK ?
      What SDK ?

      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
      • L Offline
        L Offline
        Leonardo
        wrote on 30 Dec 2019, 16:56 last edited by
        #3

        You can't use the latest NDK with Qt. For Qt 5.9 you should use NDK version r10e.

        https://doc.qt.io/qt-5/android-getting-started.html

        1 Reply Last reply
        1
        • D Offline
          D Offline
          dROb
          wrote on 1 Jan 2020, 14:18 last edited by
          #4

          Guys, thanks a lot for your answers! Due to some reason, I completely missed the "Android Getting Started" mentioned by @Leonardo.
          So according to this manual, I've reinstalled all of the components dozen of times, but so far still no luck. But I feel like now I am at least more clear in my understanding of how things work.
          Previously I had some incompatible combination of SDK's and NDK's and QT's, so today here is what I have:

          • SDK versions are 25 and 26 (25 should be working even with older QT)
          • SDK Build-tools 26.xxx, 25.xxx
          • QT version 5.9.9
          • NDK version r10e

          Today I ended up with the following stage - I have set Android JDK, SDK, and NDK in the Settings/Device/Android, but I do not have auto-added Kits for Android (the option for Automatically creating Kits is checked in Android Device). I still do not have Android compilers on the list whatever I am trying to do.

          I suppose the main question is - how to add the Compiler/Toolchain to QT ? Or how to let QT know that the Compiler is present?
          And other questions - which package of SDK actually contains the Compiler? (I suppose by name it is SDK Build Tools?)
          How do I make clean PERFECT install from the scratch? I removed QT once, and reinstalled it, but I see that it still holds my settings.

          I suppose I should:

          • Remove Android Studio (I heard rumors that SDK installed by Studio is not the "right one for QT")
          • Wipe manually the SDK directory
          • Install SDK Manager manually, and then using it, add SDK version 25 and SDK build tools?
          • Install NDK r10e
          • Add all of these to QT Creator
          • Anything else critical that I miss?
          1 Reply Last reply
          0
          • L Offline
            L Offline
            Leonardo
            wrote on 1 Jan 2020, 14:52 last edited by
            #5

            The compiler is part of NDK. In my experience, sometimes Qt Creator's settings get messed up and fail to detect the compiler. Usually I delete its settings folder to have a fresh start. On Linux it can be found at ~/.config/QtProject. I don't know on macOS.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              dROb
              wrote on 1 Jan 2020, 17:04 last edited by
              #6

              I did the full reinstall of QT again with clearing all the settings. Once again completely reinstalled SDK 24 (I found the old google package which have GUI sdkmanager ) and NDK r10e.
              QT Creator does not see the Toolchains / Compilers despite they are clearly in the Toolchains folder of NDK and does not create Compilers... I am afraid I gave up, and will take the next Windows PC for my further experiments....

              P.S. Or do you think it is worth trying to create Kits/Toolchains manually?

              D 1 Reply Last reply 2 Jan 2020, 14:08
              0
              • D dROb
                1 Jan 2020, 17:04

                I did the full reinstall of QT again with clearing all the settings. Once again completely reinstalled SDK 24 (I found the old google package which have GUI sdkmanager ) and NDK r10e.
                QT Creator does not see the Toolchains / Compilers despite they are clearly in the Toolchains folder of NDK and does not create Compilers... I am afraid I gave up, and will take the next Windows PC for my further experiments....

                P.S. Or do you think it is worth trying to create Kits/Toolchains manually?

                D Offline
                D Offline
                dROb
                wrote on 2 Jan 2020, 14:08 last edited by
                #7

                I managed to fix the problems by installing QT 5.12 instead of 5.9, and latest NDK "side by side" instead of recommended NDK.
                Despite this is the official way - NDK r10e and/or QT 5.9 does not work whatever I did.

                1 Reply Last reply
                0

                1/7

                30 Dec 2019, 14:45

                • Login

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