Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. Independent Developers
  4. Qt 6.2 'QtAndroid file not found error #include <QtAndroid> is not working....

Qt 6.2 'QtAndroid file not found error #include <QtAndroid> is not working....

Scheduled Pinned Locked Moved Solved Independent Developers
4 Posts 4 Posters 7.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NIvil Wilson
    wrote on 17 Oct 2021, 04:17 last edited by
    #1

    Screenshot from 2021-10-17 09-41-07.png

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 17 Oct 2021, 08:22 last edited by
      #2

      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 for QtAndroidExtras?

      (Z(:^

      1 Reply Last reply
      2
      • C Offline
        C Offline
        CollinK80
        wrote on 3 Nov 2022, 01:00 last edited by
        #3

        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.

        J 1 Reply Last reply 3 Nov 2022, 06:16
        0
        • C CollinK80
          3 Nov 2022, 01:00

          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.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 3 Nov 2022, 06:16 last edited by
          #4

          @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.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved