correct Android SDK and NDK to be used with Qt 5.12.1?
-
Hello,
I would like to know what is the correct Android SDK and NDK to be used with Qt 5.12.1.
I am having issues compiling and I think is a sdk/qt miss match problem.thx
-
yes I did but I still cannot compile!
"For Qt 5.12 or later, use the latest available version of NDK with android-clang toolchain."
I have the latest.I am getting the same error:
../../../../Qt/5.12.1/android_armv7/include/QtCore/qglobal.h:45:12: fatal error: 'type_traits' file not foundinclude <type_traits>
compiling on macOS Qt Creator 4.8.1 Based on Qt 5.12.0 (Clang 10.0 (Apple), 64 bit)
This is my env for Android and Java:
Android settings are OK. (SDK Version: 26.1.1, NDK Version: 19.1.5304403)
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
Qt 5.12.1I just reinstalled everything using Android Studio and have same results.
Any idea? -
Hi,
From what I read in several posts as well as personal experience, Android Studio is usually the culprit. You should rather install the command line version of the SDK directly.
-
Hi,
From what I read in several posts as well as personal experience, Android Studio is usually the culprit. You should rather install the command line version of the SDK directly.
-
Then I would try with the NDK 18 since 19 is giving your trouble.
-
The position is given in the Android Getting Started guide linked by @koahnig. Taking into account that NDK updates have a tendency to break things and not only for Qt.
-
The position is given in the Android Getting Started guide linked by @koahnig. Taking into account that NDK updates have a tendency to break things and not only for Qt.
-
@SGaist ok thx.
making some progress installing the latest qmake from android.
Previous error not showing, now on others.
Making progress!
ThxThis is the combination of SDK and NDK which can compile on windows 10 for version Qt5.12.0. It was at least at the time of installation the most recent combination (shortly after release of 5.12.0).
Just compiled an example program and started on Huawei P10 and it works.
-
Hi,
In my case :
(SDK Version: 25.2.5, NDK Version: 10.4.0)
Works on Qt5,11,1But not on qt5,12,0 or 5,12,2
Did you guys make a bugreport for this?
If so, I can add this info to the bug report. Maybe it can help to pinpoint the issue.Eddy
@Eddy I don't think a bug report is necessary. If you follow the instruction/hints in the docu, you should be fine:
https://doc.qt.io/qt-5/android-getting-started.html#installing-the-prerequisites
In order to use Qt for Android, you need the following: The Android SDK Tools Note: If your Qt version is earlier than v5.9, use the SDK tools package v25.2.5 or earlier. The Android NDK Note: Using Qt for Android with the GCC toolchain requires Android NDK version r10e. For Qt 5.12 or later, use the latest available version of NDK with android-clang toolchain. Java SE Development Kit (JDK) v6 or later. You can also use OpenJDK on Linux.
-
@Eddy I don't think a bug report is necessary. If you follow the instruction/hints in the docu, you should be fine:
https://doc.qt.io/qt-5/android-getting-started.html#installing-the-prerequisites
In order to use Qt for Android, you need the following: The Android SDK Tools Note: If your Qt version is earlier than v5.9, use the SDK tools package v25.2.5 or earlier. The Android NDK Note: Using Qt for Android with the GCC toolchain requires Android NDK version r10e. For Qt 5.12 or later, use the latest available version of NDK with android-clang toolchain. Java SE Development Kit (JDK) v6 or later. You can also use OpenJDK on Linux.
I agree also that basically it is in the prerequisites.
However IMHO it is dangerous to have such an ambiguos statement as latest available version of NDK in the document. It might be true for the moment, but may change any time.Therefore, I am positing the actual versions I am currently using.
-
I have filed a bug report for the NDK version that was used to built a Qt release to be better documented. Votes welcome:
https://bugreports.qt.io/browse/QTBUG-81752 -
Note that this has been documented properly in the patch in https://bugreports.qt.io/browse/QTBUG-81752.
Mainly:
- Qt 5.11 and below use NDK r10e with GCC toolchain.
- Qt 5.12.0 to 5.12.5 and Qt 5.13.0 to 5.13.1, use NDK r19c with android-clang toolchain
- Qt 5.14+, Qt 5.13.2+ and Qt 5.12.6+ use NDK r20b or r21 with android-clang toolchain
Also, NDK selection should be automatic starting from Qt Creator 4.12, so you won't need to worry about this then.