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. Qt + Android (ANDROID_NDK_ROOT environment variable...)
Forum Update on Monday, May 27th 2025

Qt + Android (ANDROID_NDK_ROOT environment variable...)

Scheduled Pinned Locked Moved Mobile and Embedded
androidqt 5.5ubuntu 15.04samsung tab 4
11 Posts 3 Posters 13.5k 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.
  • G Offline
    G Offline
    Garfield
    wrote on 25 Aug 2015, 08:12 last edited by
    #1

    Hello all,

    I have some trouble to cross compile a small Qt programm and load it into a Samsung Tab 4 device.

    First of all this is my configuration:
    Ubuntu 15.04
    Processor Intel Core 2 Duo CPU T7500 @ 2.20GHz*2
    OS type 32 bit
    Qt 5.5.0

    So I download all what I needed (ant, java, ndk and sdk).
    I did all the configuration part inside Qt in tools/options following several tutorials

    On Android configuration, it found 8 compilation toolchains and ticked the box to create them automatically
    In Compile and Run, I found the 8 ones under the compiler tab.
    I have created a kit manually (only the desktop one was auto detected) and getting this warning:
    the compiler ... cannot produce code for the Qt version Qt 5.5.0 32 bits

    When I open a project I get this message:
    /bin/sh: 1: /toolchains/x86-4.9/prebuilt/linux-x86/bin/i686-linux-android-gcc: not found
    Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.
    Could not read qmake configuration file /home/damien/Qt5.5.0/5.5/gcc/mkspecs/android-g++/qmake.conf.

    So far what I have done that trying to solve the problem:
    1°) on bashrc I added the following export path:
    export ANDROID_HOME=/home/damien/android-sdk-linux
    export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
    export ANDROID_HOME=/home/damien/android-ndk-r10e
    export ANDROID_SDK_ROOT=/home/damien/android-sdk-linux
    export ANDROID_NDK_ROOT=/home/damien/android-ndk-r10e
    export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
    export PATH=$PATH:$ANDROID_SDK_ROOT/tools
    export PATH=$PATH:$ANDROID_NDK

    2°) I gave all the rights to NDK by using chmod 777

    I still have the same problem and I passed at least 2 days to find on Internet what's going on.
    Does anyone have a shrink idea how to solve this problem?

    Thanks in advance,
    Damien

    P 1 Reply Last reply 25 Aug 2015, 13:33
    0
    • G Garfield
      25 Aug 2015, 08:12

      Hello all,

      I have some trouble to cross compile a small Qt programm and load it into a Samsung Tab 4 device.

      First of all this is my configuration:
      Ubuntu 15.04
      Processor Intel Core 2 Duo CPU T7500 @ 2.20GHz*2
      OS type 32 bit
      Qt 5.5.0

      So I download all what I needed (ant, java, ndk and sdk).
      I did all the configuration part inside Qt in tools/options following several tutorials

      On Android configuration, it found 8 compilation toolchains and ticked the box to create them automatically
      In Compile and Run, I found the 8 ones under the compiler tab.
      I have created a kit manually (only the desktop one was auto detected) and getting this warning:
      the compiler ... cannot produce code for the Qt version Qt 5.5.0 32 bits

      When I open a project I get this message:
      /bin/sh: 1: /toolchains/x86-4.9/prebuilt/linux-x86/bin/i686-linux-android-gcc: not found
      Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.
      Could not read qmake configuration file /home/damien/Qt5.5.0/5.5/gcc/mkspecs/android-g++/qmake.conf.

      So far what I have done that trying to solve the problem:
      1°) on bashrc I added the following export path:
      export ANDROID_HOME=/home/damien/android-sdk-linux
      export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
      export ANDROID_HOME=/home/damien/android-ndk-r10e
      export ANDROID_SDK_ROOT=/home/damien/android-sdk-linux
      export ANDROID_NDK_ROOT=/home/damien/android-ndk-r10e
      export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
      export PATH=$PATH:$ANDROID_SDK_ROOT/tools
      export PATH=$PATH:$ANDROID_NDK

      2°) I gave all the rights to NDK by using chmod 777

      I still have the same problem and I passed at least 2 days to find on Internet what's going on.
      Does anyone have a shrink idea how to solve this problem?

      Thanks in advance,
      Damien

      P Offline
      P Offline
      Pablo J. Rogina
      wrote on 25 Aug 2015, 13:33 last edited by
      #2

      @Garfield Hi, I documented this error some time ago while using Qt for Android and it looks like setting ANDROID_NDK_ROOT was enough.

      I checked again my dev environment, and the only variables set are:

      ANDROID_NDK_ROOT=C:\devtools\android-ndk-r9c
      ...
      JAVA_HOME=C:\Program Files\Java\jdk1.7.0_25
      ...
      Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Ja
      va\jdk1.7.0_25\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\Java\jdk1.7
      .0_25\jre\bin\server;C:\Python27\Lib\site-packages\PyQt4;C:\Python27;C:\Python2
      7\Scripts;C:\Perl\site\bin;C:\Perl\bin;C:\devtools\android-sdk-windows\platform-
      tools;C:\Users\pablo\AppData\Roaming\Python\Scripts;C:\Ruby200\bin

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      G 1 Reply Last reply 25 Aug 2015, 14:05
      0
      • P Pablo J. Rogina
        25 Aug 2015, 13:33

        @Garfield Hi, I documented this error some time ago while using Qt for Android and it looks like setting ANDROID_NDK_ROOT was enough.

        I checked again my dev environment, and the only variables set are:

        ANDROID_NDK_ROOT=C:\devtools\android-ndk-r9c
        ...
        JAVA_HOME=C:\Program Files\Java\jdk1.7.0_25
        ...
        Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Ja
        va\jdk1.7.0_25\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\Java\jdk1.7
        .0_25\jre\bin\server;C:\Python27\Lib\site-packages\PyQt4;C:\Python27;C:\Python2
        7\Scripts;C:\Perl\site\bin;C:\Perl\bin;C:\devtools\android-sdk-windows\platform-
        tools;C:\Users\pablo\AppData\Roaming\Python\Scripts;C:\Ruby200\bin

        G Offline
        G Offline
        Garfield
        wrote on 25 Aug 2015, 14:05 last edited by
        #3

        @Pablo-J.-Rogina Hello Thanks for your quick reply;
        Actually, I added so many paths on bashrc to be sure to resolve the problem.
        It didn't work even by just adding one.

        Do you have any others idea?

        Greetings,
        Damien

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Pablo J. Rogina
          wrote on 25 Aug 2015, 14:20 last edited by
          #4

          Well, I'll start from scratch. I first install Android SDK, Android NDK, Ant and Java and set the required environment variables, as few as possible. Then I'll install Qt so Qt Creator will find (hopefully) everything automatically and you 'll have the kits set in Qt Creator with the proper values. Just my two cents.

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          G 1 Reply Last reply 25 Aug 2015, 14:31
          0
          • P Pablo J. Rogina
            25 Aug 2015, 14:20

            Well, I'll start from scratch. I first install Android SDK, Android NDK, Ant and Java and set the required environment variables, as few as possible. Then I'll install Qt so Qt Creator will find (hopefully) everything automatically and you 'll have the kits set in Qt Creator with the proper values. Just my two cents.

            G Offline
            G Offline
            Garfield
            wrote on 25 Aug 2015, 14:31 last edited by
            #5

            @Pablo-J.-Rogina
            So you think that installing SDK and NDK before Qt creator has an impact?
            What should I do then? uninstall Qt and install it again?

            1 Reply Last reply
            0
            • P Offline
              P Offline
              Pablo J. Rogina
              wrote on 25 Aug 2015, 14:35 last edited by
              #6

              I guess that having the Android components in place before installing Qt may help you.
              Yes, uninstall Qt and install it only after you have installed all required components (Android SDJ, NDK, Ant and Java) and setting the required environment variables.

              Upvote the answer(s) that helped you solve the issue
              Use "Topic Tools" button to mark your post as Solved
              Add screenshots via postimage.org
              Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0
              • G Offline
                G Offline
                Garfield
                wrote on 25 Aug 2015, 14:36 last edited by
                #7

                Ok I will do that exactly now. thanks in advance

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  Garfield
                  wrote on 25 Aug 2015, 15:03 last edited by
                  #8

                  So I uninstalled Qt and removed all the files in the folder.
                  Nevertheless, when I reinstall it, I still get the same results and Qt creator kept also the old config. i.e the manual kit I've created

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 25 Aug 2015, 19:57 last edited by
                    #9

                    Hi and welcome to devnet,

                    IIRC, the Android SDK/NDK doesn't install the x86 compilers by default, you have to add them yourself using their management tool

                    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
                    • G Offline
                      G Offline
                      Garfield
                      wrote on 26 Aug 2015, 08:34 last edited by
                      #10

                      Hi thanks for your reply,

                      I guess I have installed all the compilers availaible using SDK manager.
                      8 toolchains were found by Qt.
                      I reinstalled everything from scratch (ubuntu, sdk, ndk, qt etc...) and it did not solve the problem.

                      I know that my problem must be a stupid thing but I just don"t get it and it frustrates me a lot.
                      do you have any other idea how to proceed?

                      Thanks in advance,
                      damien

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        Garfield
                        wrote on 26 Aug 2015, 09:41 last edited by
                        #11

                        By the way, I found that the Intel Core 2 Duo CPU T7500 is a 64 bits one.
                        I have installed Ubuntu 32 bits because there was no added value for me to install a 64 bits one.
                        for some compatibility reasons I kept also a 32 bits one when I started to use Ubuntu 4 years ago

                        Do you think that it could potential be the source of the problem or it doesn't matter?

                        1 Reply Last reply
                        0

                        1/11

                        25 Aug 2015, 08:12

                        • Login

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