Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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



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



  • I am having the same problem, but with GCC



  • 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".



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



  • Sounds like you have it sorted. Good luck.


Log in to reply