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

    • Platform/s:
      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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews