Qt 6.2 'QtAndroid file not found error #include <QtAndroid> is not working....
-
-
Well, there is no such class in Qt, so no wonder. https://doc.qt.io/qt-6/classes.html
In Qt 5 there was no such class either. Perhaps you're looking forQtAndroidExtras
? -
I just ran into this same problem while using QT 5.15.2 to try to compile an app for Android. It turns out, you need to edit CMakeLists.txt to tell it you want the AndroidExtras package. If you don't do this, it will not find the header. And, even if you edit the source so it finds the header, it will not be able to link the functions you've used unless you update CMakeLists.txt. So, that's the solution. It's totally not that obvious and the entire way Qt for Android works is ridiculous and full of razorblades. But, that's how it is. Apparently get used to doing a lot of secret steps to get things to work on Android.
-
@CollinK80 said in Qt 6.2 'QtAndroid file not found error #include <QtAndroid> is not working....:
you need to edit CMakeLists.txt to tell it you want the AndroidExtras package
Well, this is how things work: if you need something you need to tell CMake that you need it, there is no magic. I don't see what is "ridiculous" about it.