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 Creator can't find ANDROID_NDK_ROOT environment variable
QtWS25 Last Chance

Qt Creator can't find ANDROID_NDK_ROOT environment variable

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 1.7k 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.
  • I Offline
    I Offline
    istlota101
    wrote on last edited by
    #1

    Re: Qt + Android (ANDROID_NDK_ROOT environment variable...)

    I used Qt Maintenance Tool to confirm that I installed all the Android related stuff for Qt v5.13.2. Then, I used the following link to install the v2.1 Android NDK on my Ubuntu platform:
    https://www.lynxbee.com/how-to-install-android-ndk-on-ubuntu-16-04-18-04/

    But, note, that procedure EXPORTs the android NDK's folder to PATH, but does NOT set the ANDROID_NDK_ROOT environment variable. Hence, here is all the android NDK stuff I added to the end of my .bashrc file:

    Android NDK stuff

    export PATH=$PATH:~/android-ndk-r21
    ANDROID_NDK_ROOT=~/android-ndk-r21

    After that, issuing this bash cmd confirmed that my platform knows where the android NDK is:
    which ndk-build

    And, issuing this bash cmd confirmed that the environment variable was now known by my platform:
    echo $ANDROID_NDK_ROOT

    Nevertheless, Qt Creator's General Messages window reported it could not find the ANDROID_NDK_ROOT environment variable, And, sure enough, the Build Settings of Qt Creator's Project dialog dialog did NOT list the ANDROID_NDK_ROOT environment variable, not even after I rebooted my computer.

    I manually added the ANDROID_NDK_ROOT variable to Build Settings and that got rid of this problem.

    Oh, but it gets better. I then unset that variable from the Build Settings and QT Creator NOW no longer gets the General Messages warning, even though Build Settings no longer lists the ANDROID_NDK_ROOT variable.

    Now, I avoid reinstalling Qt from scratch every time some weird issue like this arises, mainly because even if that 'kludge' works, you still do not know WHY it now works.

    Ergo, I no longer have the problem, but I STILL don't know why Qt now can find the installed Android NDK. I am posting this because this HAS to be some deficiency in how Qt Creator processes system environment variables (not just ANDROID_NDK_ROOT) and I am hoping some codemeister will read this and a light bulb will go on over his head as he experiences that infamous AH-HA moment.

    jsulmJ 1 Reply Last reply
    0
    • I istlota101

      Re: Qt + Android (ANDROID_NDK_ROOT environment variable...)

      I used Qt Maintenance Tool to confirm that I installed all the Android related stuff for Qt v5.13.2. Then, I used the following link to install the v2.1 Android NDK on my Ubuntu platform:
      https://www.lynxbee.com/how-to-install-android-ndk-on-ubuntu-16-04-18-04/

      But, note, that procedure EXPORTs the android NDK's folder to PATH, but does NOT set the ANDROID_NDK_ROOT environment variable. Hence, here is all the android NDK stuff I added to the end of my .bashrc file:

      Android NDK stuff

      export PATH=$PATH:~/android-ndk-r21
      ANDROID_NDK_ROOT=~/android-ndk-r21

      After that, issuing this bash cmd confirmed that my platform knows where the android NDK is:
      which ndk-build

      And, issuing this bash cmd confirmed that the environment variable was now known by my platform:
      echo $ANDROID_NDK_ROOT

      Nevertheless, Qt Creator's General Messages window reported it could not find the ANDROID_NDK_ROOT environment variable, And, sure enough, the Build Settings of Qt Creator's Project dialog dialog did NOT list the ANDROID_NDK_ROOT environment variable, not even after I rebooted my computer.

      I manually added the ANDROID_NDK_ROOT variable to Build Settings and that got rid of this problem.

      Oh, but it gets better. I then unset that variable from the Build Settings and QT Creator NOW no longer gets the General Messages warning, even though Build Settings no longer lists the ANDROID_NDK_ROOT variable.

      Now, I avoid reinstalling Qt from scratch every time some weird issue like this arises, mainly because even if that 'kludge' works, you still do not know WHY it now works.

      Ergo, I no longer have the problem, but I STILL don't know why Qt now can find the installed Android NDK. I am posting this because this HAS to be some deficiency in how Qt Creator processes system environment variables (not just ANDROID_NDK_ROOT) and I am hoping some codemeister will read this and a light bulb will go on over his head as he experiences that infamous AH-HA moment.

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

      @istlota101 In QtCreator you can actually define where NDK is on the "Devices" tab in Options

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

      1 Reply Last reply
      2

      • Login

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