I've been experiencing this issue for 2 months. Qt Creator indicates that ndk path and directory have issues though the messages are confusing.
This happens with every Android Kit.
In Qt Creator, looking at Options -> Devices -> Android
, Android Settings display two error messages with red 'X' on the left side:
I don't have no idea what message 1 is trying to tell me, here is the structure of the directory:
.
├── build
├── meta
├── ndk-build
├── ndk-depends
├── ndk-gdb
├── ndk-which
├── NOTICE
├── NOTICE.toolchain
├── prebuilt
├── python-packages
├── README.md
├── shader-tools
├── simpleperf
├── sysroot
├── toolchains
└── wrap.sh
Regarding the second error message this is the path:
/home/user/Android/android-ndk-r18b
I can't see how could be a space in the above path.
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
Info:
I faced this problem in my project based on Ubuntu 18.04 , To avoid some errors, I highly recommend you to download Android NDK on Android Studio:
Android Studio > Tools > SDK Manager > SDK Tools > NDK (Side by side),
As shown in the following picture:
After that, it will be installed under:
/home/(UserName)/Android/Sdk/ndk
So I had chosen this path as Android Ndk path, but this was the wrong path as @Oshio said in the 2nd part of his answer, you must choose the path which is under "ndk" path, in my case:
/home/(UserName)/Android/Sdk/ndk/20.0.5594570
As shown in the following picture:
For me worked with an older version of NDK.
Also it didn't worked if I manually downloaded the NDK. But when I downloaded the NDK from the Android Studio it works.
Hope it helps :)
The root of all this trouble were two silly mistakes when unzipping the downloaded ndk.
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:
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.