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

QPluginLoader does not recognize plugin metadata from Qt < 6.3

    XMLWordPrintable

Details

    • iOS/tvOS/watchOS

    Description

      See comments below. Original description:

      If  a QML plugin using QQmlExtensionPlugin is build with Qt6.2  for iOS, as a static plugin. and  then an application is build using Qt6.4.3 that use the plugin then plugin doesn't load correctly.

      If apps are build with Qt6.2 then it works.

      With Qt6.4 apps gives this error 

      ASSERT: "!parsed.isError()" in file /Users/qt/work/qt/qtbase/src/corelib/plugin/qpluginloader.cpp, line 451
      
       

      investigating further it turns out that  the plugin metaData is empty. If the plugin and the app are both built with Qt 6.2.x, the metaData appears as expected and the plugin loads properly.

       If the plugin and the app are both built with Qt 6.4.3, the metaData appears as expected and the plugin loads properly. The problem arises when the plugin is built with Qt 6.2.x and the app is built with Qt 6.4.3 – in that case, the metaData is empty, and the plugin fails to load.

      I suspect that it is happening due to the QT_MOC_EXPORT_PLUGIN_V2 code generated in the plugin class moc file. Qt 6.2 only uses QT_MOC_EXPORT_PLUGIN, but Qt 6.4 uses QT_MOC_EXPORT_PLUGIN_V2. I suspect these are incompatible.

       

      Attached is plugin and app example which can be used to see the issue.

      The plugin is in 7920/PluginX. There is a “build.sh” script in there to build it with Qt 6.2.4 for iOS (edit build.sh to change the path to QTDIR/qmake). – the crash happens before the plugin is fully loaded.

       

      The app is in 7920/AppY. Load AppY.pro in QtCreator and configure with “Qt 6.2.4 for iOS” and “Qt 6.4.3 for iOS”. The key part is in main.cpp, where it attempts to fetch plugin.metaData() for “PluginX” and print it out with qDebug().

      When building the app with Qt 6.2.4, you see the expected JSON data printed out.

       

       

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            irfan.omair@digia.com Irfan Omair
            Votes:
            2 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes