fatal error: 'type_traits' file not found



  • When I try to build any Project with Android Kit, I receive the following error at the output:

    /opt/Qt/5.12.0/android_armv7/include/QtCore/qglobal.h:45:12: fatal error: 'type_traits' file not found
    

    This happens with every Android Kit.

    In Qt Creator, looking at Options -> Devices -> Android, Android Settings display two error messages:

    • X Android NDK directory structure is correct;
    • X Android NDK installed into a path without spaces;

    This is the content inside the NDK directory, /opt/android-studio/android-ndk-r18b:

    .
    ├── build
    ├── meta
    ├── prebuilt
    ├── python-packages
    ├── shader-tools
    ├── simpleperf
    ├── sysroot
    ├── toolchains
    └── wrap.sh
    

    I can build Desktop projects successfully.

    Info:

    • Ubuntu 18.04;
    • Qt 5.12.0;
    • Qt Creator 4.8;

  • Qt Champions 2018

    @Oshio said in fatal error: 'type_traits' file not found:

    In Qt Creator, looking at Options -> Devices -> Android, Android Settings display two error messages:

    X Android NDK directory structure is correct;
    X Android NDK installed into a path without spaces;

    That does not really look like error messages, I guess they have a green checkmark?!

    type_traits is a header for the C++ standard library.

    • Which compiler (and version) are you using for Android?
    • Do you have a type_traits header file for that compiler?


  • @aha_1980 said in fatal error: 'type_traits' file not found:

    That does not really look like error messages, I guess they have a green checkmark?!

    Unfortunately they have a red X at the side.

    I'm using clang 7.02.
    Looking at clang include directory I couldn't find any type_traits.h



  • Hello,

    I just updated to the latest Qt release and I am getting the same error:
    ../../../../Qt/5.12.1/android_armv7/include/QtCore/qglobal.h:45:12: fatal error: 'type_traits' file not found

    include <type_traits>

    compiling on macOS for Android build NDK 19b and SDK 28
    Qt Creator 4.8.1 Based on Qt 5.12.0 (Clang 10.0 (Apple), 64 bit)

    any help?
    Thx



  • Any success with this?



  • @Anton-Ti @biskero
    The root of all this trouble were two silly mistakes when unzipping the downloaded ndk.

    1. The first error is the one that motivated me to post this question and is related with my low end computer and my Ubuntu 18.04. When unzipping files, the OS doesn't provides any message warning me that the process has finished. My computer takes ~2 min to complete the extraction, so my guess is that I did a copy and paste of the folder before all the files were extracted.

    After taking notice from this fact and downloaded again the ndk, but I was getting the same errors, although I was sure the extraction was successful. And here is the another silly mistake:

    1. When unzipping the ndk, a folder is created, which contains another folder with nearly identical name, here's the structure:

      ...android-ndk-r19c-linux-x86_64/android-ndk-r19c/

      In the Qt Creator I was providing the path to ...android-ndk-r19c-linux-x86_64/ and not to ...android-ndk-r19c-linux-x86_64/android-ndk-r19c/, after altering to the correct path everything worked fine.

    Important Note: From Qt5.12 forward, is recommended to use the latest ndk version.


Log in to reply