Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt via conan package manager - macOS - "Could not resolve plugin "qtquick2plugin""
Forum Updated to NodeBB v4.3 + New Features

Qt via conan package manager - macOS - "Could not resolve plugin "qtquick2plugin""

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 651 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.
  • J Offline
    J Offline
    just_a_developer
    wrote on last edited by just_a_developer
    #1

    Hello,

    I am following this guide :
    https://www.qt.io/blog/installing-qt-via-conan-package-manager
    specifically this gif : https://www.qt.io/hs-fs/hubfs/conan_demo_app_build.gif?width=1600&name=conan_demo_app_build.gif .

    I am using the macos-universal-clang conan profile.

    I can build and run the "texteditor" Qt example application (unmodified), but when I run the built application, I get this error :
    "
    qt.qml.import: addImportPath: "/Users/myUser/.conan/data/qtbase/6.2.2/qt/everywhere/package/2b03afe371e4c5cfd9436080f6a933311ea6faef/qml"
    qt.qml.import: addImportPath: "qrc:/qt-project.org/imports"
    qt.qml.import: addImportPath: "/Users/myUser/Qt/Examples/Qt-6.2.1/quickcontrols2/texteditor/build/texteditor.app/Contents/MacOS"
    qt.qml.import: addLibraryImport: qrc:/qml/texteditor.qml "QtQuick" invalid as ""
    qt.qml.import: importExtension: qrc:/qml/texteditor.qml loaded ":/qt-project.org/imports/QtQuick/qmldir"
    qt.qml.import: resolvePlugin Could not resolve plugin "qtquick2plugin" in ":/qt-project.org/imports/QtQuick"
    qt.qml.import: addLibraryImport: qrc:/qml/texteditor.qml "QtQml" 6.2 as ""
    qt.qml.import: importExtension: qrc:/qml/texteditor.qml loaded ":/qt-project.org/imports/QtQml/qmldir"
    qt.qml.import: resolvePlugin Could not resolve plugin "qmlplugin" in ":/qt-project.org/imports/QtQml"
    qt.qml.import: addLibraryImport: qrc:/qml/texteditor.qml "QtQml.Models" 6.2 as ""
    qt.qml.import: importExtension: qrc:/qml/texteditor.qml loaded ":/qt-project.org/imports/QtQml/Models/qmldir"
    qt.qml.import: resolvePlugin Could not resolve plugin "modelsplugin" in ":/qt-project.org/imports/QtQml/Models"
    qt.qml.import: addLibraryImport: qrc:/qml/texteditor.qml "QtQml.WorkerScript" 6.2 as ""
    qt.qml.import: addLibraryImport: qrc:/qml/texteditor.qml "QtCore" invalid as ""
    qt.qml.import: addLibraryImport: qrc:/qml/texteditor.qml "QtQuick.Controls" invalid as ""
    qt.qml.import: importExtension: qrc:/qml/texteditor.qml loaded ":/qt-project.org/imports/QtQuick/Controls/qmldir"
    qt.qml.import: resolvePlugin Could not resolve plugin "qtquickcontrols2plugin" in ":/qt-project.org/imports/QtQuick/Controls"
    QQmlApplicationEngine failed to load component
    qrc:/qml/texteditor.qml:53:1: module "QtQuick.Controls" plugin "qtquickcontrols2plugin" not found
    "

    What should I do to fix this?

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

      I got it working :

      A bit of context :
      1.: official qt conan package MUST be consumed using the --generator=virtualenv
      2.: this generator generates activate.sh and environment.sh.env
      3.: source activate.sh must be called for both the build, and to run the built app

      So the issue was that I was calling source activate.sh from my build script, so the variables weren't defined any more, when I tried to run my built app (outside of the script).

      So now I can use this script to run this texteditor example app (/Users/myUser/Qt/Examples/Qt-6.2.1/quickcontrols2/texteditor/) :

      set -e
      
      conan install qtbuildprofiles/6.2.2@qt/everywhere -r qt
      
      conan install -u conanfile.txt --profile=macos-universal-clang --build=never --update --generator=virtualenv -r qt
      source activate.sh
      
      mkdir -p build
      cd build
      echo "cmake ../ -G Ninja -DCMAKE_BUILD_TYPE=Release"
      cmake ../ -G Ninja -DCMAKE_BUILD_TYPE=Release
      VERBOSE=1 cmake --build . --config Release --clean-first
      cd ..
      
      #Run the built app :
      ./build/texteditor.app/Contents/MacOS/texteditor
      
      
      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