Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Qt6 Android CMake project fails at start: Failed to find Qt component "Core" config file at ""
QtWS25 Last Chance

Qt6 Android CMake project fails at start: Failed to find Qt component "Core" config file at ""

Scheduled Pinned Locked Moved Unsolved Qt 6
12 Posts 9 Posters 14.5k 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.
  • advmA Offline
    advmA Offline
    advm
    wrote on last edited by advm
    #1

    Hello, I have problem when I create new QtQuick project with Qt6 android with CMake. The CMake fails immediately after creation of the project:

    CMake Error at CMakeLists.txt:28 (find_package):
      Found package configuration file:
    
        C:/Qt/6.0.0/android_armv7/lib/cmake/Qt6/Qt6Config.cmake
    
      but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
      FOUND.  Reason given by package:
    
      Failed to find Qt component "Core" config file at ""
    
      Failed to find Qt component "Quick" config file at ""
    

    I have tried to solve it and I found similar bugs already reported but still could not find solution. Any suggestion or help is welcome. Thanks in advance.

    UPDATE: I noticed too, that after I install new android kit(for example 5.12.10 x86 and armv7) via MaintenanceTool all my Qt6 android kits are deleted. But msvc and mingw Qt6 kits are not deleted.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jhorns2
      wrote on last edited by
      #2

      I am having the same problem, but with GCC

      advmA 1 Reply Last reply
      0
      • J Offline
        J Offline
        Jhorns2
        wrote on last edited by Jhorns2
        #3

        Are you developing on a Linux VM? After some troubleshooting I found I had to install OpenGL.

        sudo apt-get install libgl1-mesa-dev

        I found my problem by doing the following.

        To troubleshoot this, you can do the following. Go to directory with your CMakeLists.txt for your project. Open a shell there.

        Set the CMAKE_PREFIX_PATH to wherever you installed Qt (your path will be different and you are using android)
        Here's what mine looked like:
        export $CMAKE_PREFIX_PATH=/home/dev/Qt/6.0.0/gcc_64

        mkdir build
        cd build
        cmake ..

        My output is:

        -- Looking for C++ include pthread.h
        -- Looking for C++ include pthread.h - found
        -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
        -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
        -- Check if compiler accepts -pthread
        -- Check if compiler accepts -pthread - yes
        -- Found Threads: TRUE
        -- Performing Test HAVE_STDATOMIC
        -- Performing Test HAVE_STDATOMIC - Success
        -- Found WrapAtomic: TRUE
        -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY OPENGL_INCLUDE_DIR)
        -- Could NOT find WrapOpenGL (missing: WrapOpenGL_FOUND)
        CMake Warning at /usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
        Found package configuration file:

        /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6Gui/Qt6GuiConfig.cmake
        

        but it set Qt6Gui_FOUND to FALSE so package "Qt6Gui" is considered to be
        NOT FOUND. Reason given by package:

        Qt6Gui could not be found because dependency WrapOpenGL could not be found.

        Call Stack (most recent call first):
        /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6Quick/Qt6QuickDependencies.cmake:86 (find_dependency)
        /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6Quick/Qt6QuickConfig.cmake:38 (include)
        /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6/Qt6Config.cmake:83 (find_package)
        CMakeLists.txt:28 (find_package)

        CMake Warning at /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6/Qt6Config.cmake:83 (find_package):
        Found package configuration file:

        /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6Quick/Qt6QuickConfig.cmake
        

        but it set Qt6Quick_FOUND to FALSE so package "Qt6Quick" is considered to
        be NOT FOUND. Reason given by package:

        The following imported targets are referenced, but are missing: Qt6::Qml
        Qt6::QmlModels Qt6::QmlModelsPrivate Qt6::QmlPrivate

        Call Stack (most recent call first):
        CMakeLists.txt:28 (find_package)

        CMake Error at CMakeLists.txt:28 (find_package):
        Found package configuration file:

        /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6/Qt6Config.cmake
        

        but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
        FOUND. Reason given by package:

        Failed to find Qt component "Quick" config file at ""

        -- Configuring incomplete, errors occurred!
        See also "/home/dev/NodeDev/build/CMakeFiles/CMakeOutput.log".
        See also "/home/dev/NodeDev/build/CMakeFiles/CMakeError.log".

        B Haowei HsuH 2 Replies Last reply
        6
        • J Jhorns2

          I am having the same problem, but with GCC

          advmA Offline
          advmA Offline
          advm
          wrote on last edited by advm
          #4

          @Jhorns2

          Are you developing on a Linux VM?

          No, I am on Windows.

          After it deleted my Qt6 android kits(as I mentioned in my Update), I reinstalled the Kits and it works now. There is no problem with finding components. I don't know what caused the error.

          But I also noticed other small problem like: Creating Template Android project, creates the project(android folder), but is not displaying it in project structure in QtCreator even that I have this line in CMakeLists.txt:

          set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
          

          and it displays error Could not update the project file "C:\Users\user\QtProjects\qttutorials\Test\."

          But its ok, this problem is not related to the posted Question.

          1 Reply Last reply
          0
          • J Offline
            J Offline
            Jhorns2
            wrote on last edited by
            #5

            Sounds like you have it sorted. Good luck.

            1 Reply Last reply
            1
            • J Jhorns2

              Are you developing on a Linux VM? After some troubleshooting I found I had to install OpenGL.

              sudo apt-get install libgl1-mesa-dev

              I found my problem by doing the following.

              To troubleshoot this, you can do the following. Go to directory with your CMakeLists.txt for your project. Open a shell there.

              Set the CMAKE_PREFIX_PATH to wherever you installed Qt (your path will be different and you are using android)
              Here's what mine looked like:
              export $CMAKE_PREFIX_PATH=/home/dev/Qt/6.0.0/gcc_64

              mkdir build
              cd build
              cmake ..

              My output is:

              -- Looking for C++ include pthread.h
              -- Looking for C++ include pthread.h - found
              -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
              -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
              -- Check if compiler accepts -pthread
              -- Check if compiler accepts -pthread - yes
              -- Found Threads: TRUE
              -- Performing Test HAVE_STDATOMIC
              -- Performing Test HAVE_STDATOMIC - Success
              -- Found WrapAtomic: TRUE
              -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY OPENGL_INCLUDE_DIR)
              -- Could NOT find WrapOpenGL (missing: WrapOpenGL_FOUND)
              CMake Warning at /usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
              Found package configuration file:

              /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6Gui/Qt6GuiConfig.cmake
              

              but it set Qt6Gui_FOUND to FALSE so package "Qt6Gui" is considered to be
              NOT FOUND. Reason given by package:

              Qt6Gui could not be found because dependency WrapOpenGL could not be found.

              Call Stack (most recent call first):
              /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6Quick/Qt6QuickDependencies.cmake:86 (find_dependency)
              /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6Quick/Qt6QuickConfig.cmake:38 (include)
              /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6/Qt6Config.cmake:83 (find_package)
              CMakeLists.txt:28 (find_package)

              CMake Warning at /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6/Qt6Config.cmake:83 (find_package):
              Found package configuration file:

              /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6Quick/Qt6QuickConfig.cmake
              

              but it set Qt6Quick_FOUND to FALSE so package "Qt6Quick" is considered to
              be NOT FOUND. Reason given by package:

              The following imported targets are referenced, but are missing: Qt6::Qml
              Qt6::QmlModels Qt6::QmlModelsPrivate Qt6::QmlPrivate

              Call Stack (most recent call first):
              CMakeLists.txt:28 (find_package)

              CMake Error at CMakeLists.txt:28 (find_package):
              Found package configuration file:

              /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6/Qt6Config.cmake
              

              but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
              FOUND. Reason given by package:

              Failed to find Qt component "Quick" config file at ""

              -- Configuring incomplete, errors occurred!
              See also "/home/dev/NodeDev/build/CMakeFiles/CMakeOutput.log".
              See also "/home/dev/NodeDev/build/CMakeFiles/CMakeError.log".

              B Offline
              B Offline
              beeka
              wrote on last edited by
              #6

              I had this issue with Qt6.2.2 on Fedora 35 in a VM... I had to install the GL libraries but it seemed that mesa wasn't right. What worked for me is:

              sudo dnf install libglvnd-devel
              

              PS: Sorry for the the necropost... but this was the closest thread to my issue and the GL dev library hint was what helped me.

              A 1 Reply Last reply
              2
              • F Offline
                F Offline
                Frostybeard 0
                wrote on last edited by
                #7

                I have the issue described by jhorns above and am running Ubuntu 20.04.
                I installed the 2 packages: libgl1-mesa-dev, libglvnd-devel
                I still get similar OpenGL errors in the CMake phase.

                jsulmJ 1 Reply Last reply
                0
                • F Frostybeard 0

                  I have the issue described by jhorns above and am running Ubuntu 20.04.
                  I installed the 2 packages: libgl1-mesa-dev, libglvnd-devel
                  I still get similar OpenGL errors in the CMake phase.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @Frostybeard-0 said in Qt6 Android CMake project fails at start: Failed to find Qt component "Core" config file at "":

                  I still get similar OpenGL errors in the CMake phase

                  Can you post those?

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

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    danielsanchez
                    wrote on last edited by
                    #9

                    Think is late but I had the same error with Ubuntu 22.04 and Clion, so to fix this i installed libgl1-mesa-dev and libglvnd-dev libraries, then Clion will ask for 'Qt CMake prefix path', and you need to choose the directory where the files are stored, in my case was:
                    /y/y/y/Qt/6.3.1/gcc_64/lib/cmake

                    Now, it works. Hope it helps.

                    1 Reply Last reply
                    3
                    • J Jhorns2

                      Are you developing on a Linux VM? After some troubleshooting I found I had to install OpenGL.

                      sudo apt-get install libgl1-mesa-dev

                      I found my problem by doing the following.

                      To troubleshoot this, you can do the following. Go to directory with your CMakeLists.txt for your project. Open a shell there.

                      Set the CMAKE_PREFIX_PATH to wherever you installed Qt (your path will be different and you are using android)
                      Here's what mine looked like:
                      export $CMAKE_PREFIX_PATH=/home/dev/Qt/6.0.0/gcc_64

                      mkdir build
                      cd build
                      cmake ..

                      My output is:

                      -- Looking for C++ include pthread.h
                      -- Looking for C++ include pthread.h - found
                      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
                      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
                      -- Check if compiler accepts -pthread
                      -- Check if compiler accepts -pthread - yes
                      -- Found Threads: TRUE
                      -- Performing Test HAVE_STDATOMIC
                      -- Performing Test HAVE_STDATOMIC - Success
                      -- Found WrapAtomic: TRUE
                      -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY OPENGL_INCLUDE_DIR)
                      -- Could NOT find WrapOpenGL (missing: WrapOpenGL_FOUND)
                      CMake Warning at /usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
                      Found package configuration file:

                      /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6Gui/Qt6GuiConfig.cmake
                      

                      but it set Qt6Gui_FOUND to FALSE so package "Qt6Gui" is considered to be
                      NOT FOUND. Reason given by package:

                      Qt6Gui could not be found because dependency WrapOpenGL could not be found.

                      Call Stack (most recent call first):
                      /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6Quick/Qt6QuickDependencies.cmake:86 (find_dependency)
                      /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6Quick/Qt6QuickConfig.cmake:38 (include)
                      /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6/Qt6Config.cmake:83 (find_package)
                      CMakeLists.txt:28 (find_package)

                      CMake Warning at /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6/Qt6Config.cmake:83 (find_package):
                      Found package configuration file:

                      /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6Quick/Qt6QuickConfig.cmake
                      

                      but it set Qt6Quick_FOUND to FALSE so package "Qt6Quick" is considered to
                      be NOT FOUND. Reason given by package:

                      The following imported targets are referenced, but are missing: Qt6::Qml
                      Qt6::QmlModels Qt6::QmlModelsPrivate Qt6::QmlPrivate

                      Call Stack (most recent call first):
                      CMakeLists.txt:28 (find_package)

                      CMake Error at CMakeLists.txt:28 (find_package):
                      Found package configuration file:

                      /home/dev/Qt/6.0.0/gcc_64/lib/cmake/Qt6/Qt6Config.cmake
                      

                      but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
                      FOUND. Reason given by package:

                      Failed to find Qt component "Quick" config file at ""

                      -- Configuring incomplete, errors occurred!
                      See also "/home/dev/NodeDev/build/CMakeFiles/CMakeOutput.log".
                      See also "/home/dev/NodeDev/build/CMakeFiles/CMakeError.log".

                      Haowei HsuH Offline
                      Haowei HsuH Offline
                      Haowei Hsu
                      wrote on last edited by
                      #10

                      @Jhorns2 I met the similar problem in Kubuntu 22.04. So I ran the command you provided, and it solved my problem. Thanks!

                      sudo apt-get install libgl1-mesa-dev
                      
                      1 Reply Last reply
                      0
                      • B Offline
                        B Offline
                        BarrRobot
                        wrote on last edited by
                        #11

                        "sudo apt-get install libgl1-mesa-dev" also worked for me with the error "failed to find required Qt component 'Gui' "
                        (Ubuntu 24.04 LTS)

                        1 Reply Last reply
                        0
                        • B beeka

                          I had this issue with Qt6.2.2 on Fedora 35 in a VM... I had to install the GL libraries but it seemed that mesa wasn't right. What worked for me is:

                          sudo dnf install libglvnd-devel
                          

                          PS: Sorry for the the necropost... but this was the closest thread to my issue and the GL dev library hint was what helped me.

                          A Offline
                          A Offline
                          ajunior
                          wrote on last edited by ajunior
                          #12

                          I just had this problem, and installing libglvnd-devel solved the problem.

                          sudo dnf install libglvnd-devel
                          
                          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