Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-96261

QtQuickControls2 based application fails to run on macOS after using macdeployqt on it

    XMLWordPrintable

Details

    • macOS

    Description

      Steps to reproduce

      $ ../installed/bin/qt-cmake ~/dev/qtdeclarative/examples/quickcontrols2/gallery/
      $ ninja
      $ ./gallery_controls2.app/Contents/MacOS/gallery_controls2 -> runs fine
      $ ../installed/bin/macdeployqt ./gallery_controls2.app -qmldir=~/dev/qtdeclarative/examples/quickcontrols2/gallery/
      $ ./gallery_controls2.app/Contents/MacOS/gallery_controls2 -> fails
      

      Fails with

      ./gallery_controls2.app/Contents/MacOS/gallery_controls2
      QQmlApplicationEngine failed to load component
      qrc:/gallery.qml:58:1: Type ApplicationWindow unavailable
      qrc:/qt-project.org/imports/QtQuick/Controls/Fusion/ApplicationWindow.qml:41:1: module "QtQuick.Controls.Fusion.impl" plugin "implplugin" not found
      

      When running macdeloyqt the following warnings are shown.

      File exists, skip copy: "gallery_controls2.app/Contents/PlugIns/quick/libimplplugin.dylib"
      File exists, skip copy: "gallery_controls2.app/Contents/PlugIns/quick/libimplplugin.dylib"
      File exists, skip copy: "gallery_controls2.app/Contents/PlugIns/quick/libimplplugin.dylib"
      File exists, skip copy: "gallery_controls2.app/Contents/PlugIns/quick/libimplplugin.dylib"
      File exists, skip copy: "gallery_controls2.app/Contents/PlugIns/quick/libimplplugin.dylib"
      

      macdeployqt skips similarly named plugin libraries despite them being associated with a different qml module

      $ fd ibimplplugin                                                                                                                                                                                                                                                     130 ↵
      gallery_controls2.app/Contents/PlugIns/quick/libimplplugin.dylib
      gallery_controls2.app/Contents/Resources/qml/QtQuick/Controls/Basic/impl/libimplplugin.dylib
      gallery_controls2.app/Contents/Resources/qml/QtQuick/Controls/Basic/impl/libimplplugin.dylib.dSYM
      gallery_controls2.app/Contents/Resources/qml/QtQuick/Controls/Fusion/impl/libimplplugin.dylib.dSYM
      gallery_controls2.app/Contents/Resources/qml/QtQuick/Controls/Imagine/impl/libimplplugin.dylib.dSYM
      gallery_controls2.app/Contents/Resources/qml/QtQuick/Controls/Material/impl/libimplplugin.dylib.dSYM
      gallery_controls2.app/Contents/Resources/qml/QtQuick/Controls/Universal/impl/libimplplugin.dylib.dSYM
      gallery_controls2.app/Contents/Resources/qml/QtQuick/Controls/impl/libimplplugin.dylib.dSYM
      

      I guess it does that because it's flattening / copying each .dylib into Contents/PlugIns/quick/
      but then creates a symlink under the Resources folders to recreate the qml import path.

      I guess we need to specify unique file names for each of those impl plugins.

      Attachments

        For Gerrit Dashboard: QTBUG-96261
        # Subject Branch Project Status CR V

        Activity

          People

            qtbuildsystem Qt Build System Team
            alexandru.croitor Alexandru Croitor
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews