QQmlApplicationEngine failed to load component
Unsolved
Mobile and Embedded
-
The QtQuick program runs without problems on the desktop, but when I compile for an embedded linux system and afterwards try to run the program on the MCU i get the error, but the error first occurs when the program is executed in the embedded linux. There is not issues or messages during compilation. In the command prompt I get the following error.
QQmlApplicationEngine failed to load component
<Unknown File>: Module "GPIO_InputTest2" contains no type named "Main"This could indicate that the "Main.qml" were not correctly included - The CMakeLists.txt looks like this:
cmake_minimum_required(VERSION 3.16) project(GPIO_InputTest2 VERSION 0.1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(Qt6 REQUIRED COMPONENTS Quick) qt_standard_project_setup(REQUIRES 6.5) qt_add_executable(appGPIO_InputTest2 main.cpp VirtualInputReader.cpp VirtualInputReader.h ) qt_add_qml_module(appGPIO_InputTest2 URI GPIO_InputTest2 VERSION 1.0 QML_FILES "Main.qml" SOURCES VirtualInputReader.h VirtualInputReader.cpp RESOURCE_PREFIX / ) # Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. # If you are developing for iOS or macOS you should consider setting an # explicit, fixed bundle identifier manually though. set_target_properties(appGPIO_InputTest2 PROPERTIES # MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appGPIO_InputTest2 MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE TRUE WIN32_EXECUTABLE TRUE ) target_link_libraries(appGPIO_InputTest2 PRIVATE Qt6::Quick ) include(GNUInstallDirs) install(TARGETS appGPIO_InputTest2 BUNDLE DESTINATION . LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
Both main.cpp and Main.qml are added.
Any suggestions where the problem is?