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. Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.
Forum Updated to NodeBB v4.3 + New Features

Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.

Scheduled Pinned Locked Moved Solved Mobile and Embedded
24 Posts 6 Posters 22.1k 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi,

    It looks like you are trying to do that in a terminal and modify settings in an application. What exactly are you doing ?

    Since you have it working in Qt Creator as it seems, just define these environment variable for the terminal you want to build qtmqtt in.

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

    2 1 Reply Last reply
    0
    • Quang PhuQ Offline
      Quang PhuQ Offline
      Quang Phu
      wrote on last edited by
      #3

      @20Stefan05 ,

      If you want to install mqtt module, you have to install it inside lib of android, and they will make for all architecture.
      You can refer this link to install it.
      https://forum.qt.io/topic/107020/how-to-use-mqtt-client-class-in-qml/9

      1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        It looks like you are trying to do that in a terminal and modify settings in an application. What exactly are you doing ?

        Since you have it working in Qt Creator as it seems, just define these environment variable for the terminal you want to build qtmqtt in.

        2 Offline
        2 Offline
        20Stefan05
        wrote on last edited by 20Stefan05
        #4

        @SGaist said in Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.:

        Hi,

        It looks like you are trying to do that in a terminal and modify settings in an application. What exactly are you doing ?

        Since you have it working in Qt Creator as it seems, just define these environment variable for the terminal you want to build qtmqtt in.

        Hi and thank you for the reply. It works in the Qt Creator, but only for gcc_64. How should I define the environment variables?

        jsulmJ 1 Reply Last reply
        0
        • 2 20Stefan05

          @SGaist said in Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.:

          Hi,

          It looks like you are trying to do that in a terminal and modify settings in an application. What exactly are you doing ?

          Since you have it working in Qt Creator as it seems, just define these environment variable for the terminal you want to build qtmqtt in.

          Hi and thank you for the reply. It works in the Qt Creator, but only for gcc_64. How should I define the environment variables?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #5

          @20Stefan05 said in Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.:

          How should I define the environment variables?

          In the same way they are set in Build Environment in QtCreator: "Projects/Build & Run/Build/Build Environment".

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

          2 1 Reply Last reply
          0
          • jsulmJ jsulm

            @20Stefan05 said in Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.:

            How should I define the environment variables?

            In the same way they are set in Build Environment in QtCreator: "Projects/Build & Run/Build/Build Environment".

            2 Offline
            2 Offline
            20Stefan05
            wrote on last edited by 20Stefan05
            #6

            @jsulm Thank you! But the ANDROID_NDK_ROOT variable points my Android NDK.

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

              In your terminal ?

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

              2 1 Reply Last reply
              0
              • SGaistS SGaist

                In your terminal ?

                2 Offline
                2 Offline
                20Stefan05
                wrote on last edited by
                #8

                @SGaist Screenshot from 2020-05-29 21-49-30.png
                Here.

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

                  Well... that's Qt Creator. You have to set them in the terminal you are using to build the module.

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

                  2 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Well... that's Qt Creator. You have to set them in the terminal you are using to build the module.

                    2 Offline
                    2 Offline
                    20Stefan05
                    wrote on last edited by
                    #10

                    @SGaist But I don't know how to do it. Could you help me?

                    mrjjM 1 Reply Last reply
                    0
                    • 2 20Stefan05

                      @SGaist But I don't know how to do it. Could you help me?

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #11

                      @20Stefan05
                      Hi
                      https://www.serverlab.ca/tutorials/linux/administration-linux/how-to-set-environment-variables-in-linux/

                      so try
                      export ANDROID_NDK_ROOT=/home/stefan/Downloads/android-ndk-r19c/android-ndk-r19c
                      in the terminal

                      2 1 Reply Last reply
                      0
                      • mrjjM mrjj

                        @20Stefan05
                        Hi
                        https://www.serverlab.ca/tutorials/linux/administration-linux/how-to-set-environment-variables-in-linux/

                        so try
                        export ANDROID_NDK_ROOT=/home/stefan/Downloads/android-ndk-r19c/android-ndk-r19c
                        in the terminal

                        2 Offline
                        2 Offline
                        20Stefan05
                        wrote on last edited by
                        #12

                        @mrjj Thank you!

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          Sudhir Khanger
                          wrote on last edited by
                          #13

                          Does Qt 5.15.0 works with ndk side-by-side? I have ndk version 21.2.6472646 installed via Android Studio. Qt Creator keeps wanting me to install 21.2.63xxxxx version.

                          Where can I find which Qt version requires which NDK version?

                          mrjjM 1 Reply Last reply
                          0
                          • S Sudhir Khanger

                            Does Qt 5.15.0 works with ndk side-by-side? I have ndk version 21.2.6472646 installed via Android Studio. Qt Creator keeps wanting me to install 21.2.63xxxxx version.

                            Where can I find which Qt version requires which NDK version?

                            mrjjM Offline
                            mrjjM Offline
                            mrjj
                            Lifetime Qt Champion
                            wrote on last edited by
                            #14

                            @Sudhir-Khanger

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

                            Qt 5.14.0 or later, Qt 5.13.2 or later, and Qt 5.12.6 or later
                            NDK r20b or r21
                            android-clang
                            Note: Qt 5.14.0 and 5.14.1 with NDK r21 have a bug fixed at QTBUG-81461.
                            
                            Qt 5.12.0 to 5.12.5 and Qt 5.13.0 to 5.13.1
                            NDK r19c
                            android-clang
                            Qt 5.11 and below
                            NDK r10e
                            GCC toolchain
                            
                            S 1 Reply Last reply
                            1
                            • mrjjM mrjj

                              @Sudhir-Khanger

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

                              Qt 5.14.0 or later, Qt 5.13.2 or later, and Qt 5.12.6 or later
                              NDK r20b or r21
                              android-clang
                              Note: Qt 5.14.0 and 5.14.1 with NDK r21 have a bug fixed at QTBUG-81461.
                              
                              Qt 5.12.0 to 5.12.5 and Qt 5.13.0 to 5.13.1
                              NDK r19c
                              android-clang
                              Qt 5.11 and below
                              NDK r10e
                              GCC toolchain
                              
                              S Offline
                              S Offline
                              Sudhir Khanger
                              wrote on last edited by
                              #15

                              @mrjj said in Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.:

                              @Sudhir-Khanger

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

                              Qt 5.14.0 or later, Qt 5.13.2 or later, and Qt 5.12.6 or later
                              NDK r20b or r21
                              android-clang
                              Note: Qt 5.14.0 and 5.14.1 with NDK r21 have a bug fixed at QTBUG-81461.
                              
                              Qt 5.12.0 to 5.12.5 and Qt 5.13.0 to 5.13.1
                              NDK r19c
                              android-clang
                              Qt 5.11 and below
                              NDK r10e
                              GCC toolchain
                              

                              There is no version r21. There's a version 21c which seems to have issue with Qt 5.15.0

                              https://developer.android.com/ndk/downloads/revision_history

                              1 Reply Last reply
                              0
                              • S Offline
                                S Offline
                                Sudhir Khanger
                                wrote on last edited by
                                #16

                                This is a bit problematic. There is no mention of r21 on NDK Revision History or NDK Downloads or Unsupported NDK Downloads. Qt should try to support the latest NDK which would be r21d.

                                mrjjM 1 Reply Last reply
                                0
                                • S Sudhir Khanger

                                  This is a bit problematic. There is no mention of r21 on NDK Revision History or NDK Downloads or Unsupported NDK Downloads. Qt should try to support the latest NDK which would be r21d.

                                  mrjjM Offline
                                  mrjjM Offline
                                  mrjj
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #17

                                  @Sudhir-Khanger
                                  Hi
                                  but dont r21d works ?

                                  S 1 Reply Last reply
                                  0
                                  • mrjjM mrjj

                                    @Sudhir-Khanger
                                    Hi
                                    but dont r21d works ?

                                    S Offline
                                    S Offline
                                    Sudhir Khanger
                                    wrote on last edited by
                                    #18

                                    @mrjj said in Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.:

                                    @Sudhir-Khanger
                                    Hi
                                    but dont r21d works ?

                                    I have my setup working with an older version of NDK which probably corresponds to r21. It didn't work for me with newer version of NDK.

                                    mrjjM 1 Reply Last reply
                                    0
                                    • S Sudhir Khanger

                                      @mrjj said in Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.:

                                      @Sudhir-Khanger
                                      Hi
                                      but dont r21d works ?

                                      I have my setup working with an older version of NDK which probably corresponds to r21. It didn't work for me with newer version of NDK.

                                      mrjjM Offline
                                      mrjjM Offline
                                      mrjj
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #19

                                      @Sudhir-Khanger
                                      Hi
                                      This is with Qt5.15.0. correct ?

                                      S 1 Reply Last reply
                                      0
                                      • mrjjM mrjj

                                        @Sudhir-Khanger
                                        Hi
                                        This is with Qt5.15.0. correct ?

                                        S Offline
                                        S Offline
                                        Sudhir Khanger
                                        wrote on last edited by
                                        #20

                                        @mrjj said in Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.:

                                        @Sudhir-Khanger
                                        Hi
                                        This is with Qt5.15.0. correct ?

                                        Yes, the latest version of NDK doesn't work with the latest stable version of Qt.

                                        alt text
                                        alt text

                                        mrjjM 1 Reply Last reply
                                        0
                                        • S Sudhir Khanger

                                          @mrjj said in Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.:

                                          @Sudhir-Khanger
                                          Hi
                                          This is with Qt5.15.0. correct ?

                                          Yes, the latest version of NDK doesn't work with the latest stable version of Qt.

                                          alt text
                                          alt text

                                          mrjjM Offline
                                          mrjjM Offline
                                          mrjj
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #21

                                          @Sudhir-Khanger
                                          Hi
                                          Ok thank you. did you try the Obsolete thing from ticket ?
                                          https://bugreports.qt.io/browse/QTCREATORBUG-23794

                                          Turn off "Hide obsolete Packages".
                                          Install "Android SDK Tools (Obsolete)".

                                          S 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