Important: Please read the Qt Code of Conduct -

__ANDROID_API__ define has a strange behavior

  • Hi Forum,

    I was wondering why the ANDROID_API define on the compile line is not set with the requested version which is defined in the AndroidManifest.xml. If you modify that information in the manifest file, then save & exit, the define is set with the correct value (21). If you open a project without editing the manifest file, that define is set with the defaut API version (16). I tried to set env var's and force the Android build sdk to android-21 in the project buid settings but the result is the same (the compile cmdline always use the android-16 version).

    the only solution I have found is to systematically edit the manifest, change it, save it to another version and return to the desired version by doing the same operation.
    Current config : QtCreator 4.6.1/ Android for armeabi-v7a (GCC4.9, Qt5.11.0)/NDK r10e

    Any idea about that behavior ?
    Thanks a lot.

  • Lifetime Qt Champion


    Might be a Qt Creator issue, can you try with a more recent version ?

  • Hi Samuel,
    Apparently, it is the same thing with QtCreator 4.8.0.

  • Hi all,
    I switched to the following configuration : Qt5.12, QtCreator 4.8.0, NDK r18b, Clang++ compiler and the issue no longer occurs.

Log in to reply