Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Plugin verification data mismatch error on my plugin load
Forum Updated to NodeBB v4.3 + New Features

Plugin verification data mismatch error on my plugin load

Scheduled Pinned Locked Moved General and Desktop
16 Posts 3 Posters 7.4k Views 1 Watching
  • 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #4

    Do you mean you are trying to load a static plugin ?

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Abin
      wrote on last edited by
      #5

      Sorry to confuse you.

      I am building my project in Release mode. I have already build my plugin code in release mode and my plugin lib name is serverplugin.dll.

      While running I try to load serverplugin.dll,

      @QDir pluginsDir(qApp->applicationDirPath());
      qDebug() << Q_FUNC_INFO << "pluginsDir.dirName"<< pluginsDir.dirName();
      #if defined(Q_OS_WIN)
      if (pluginsDir.dirName().toLower() == "debug" || pluginsDir.dirName().toLower() == "release") {
      pluginsDir.cdUp();
      pluginsDir.cdUp();
      pluginsDir.cd("plugins");
      }
      #endif
      foreach (QString fileName, pluginsDir.entryList(QDir::Files))
      {
      qDebug() << Q_FUNC_INFO << "fileName" << fileName;
      QPluginLoader pluginLoader(pluginsDir.absoluteFilePath(fileName));
      bool pluginLoaded = pluginLoader.isLoaded();
      qDebug() << Q_FUNC_INFO << "pluginLoaded" << pluginLoaded;
      qDebug() << Q_FUNC_INFO << "pluginLoaded" <<
      pluginLoader.errorString();
      QObject *plugin = pluginLoader.instance();
      if (plugin)
      {
      qDebug()<<Q_FUNC_INFO<<"plugin instance is loaded";
      m_pServerInterface = qobject_cast<ServerInterface *>(plugin);
      if (NULL != m_pServerInterface)
      {
      qDebug() << Q_FUNC_INFO << "plugin loaded successfully";
      }
      else
      {
      //error screen should be displayed.
      qDebug() << Q_FUNC_INFO <<
      "plugin object casted to "
      "ServerInterface is Null";
      }
      }
      }@

      I get :

      void MainFrame::loadPlugin() fileName "serverplugin.dll"
      void MainFrame::loadPlugin() pluginLoaded false
      void MainFrame::loadPlugin() pluginLoaded "Unknown error"
      void MainFrame::loadPlugin() plugin instance is loaded
      void MainFrame::loadPlugin() plugin loaded successfully

      ie, My plugin is not loaded successfully but still instance is returned. This happens in windows. But when I build for android it totally fails to get any instance of the plugin

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #6

        Does your plugin have any dependencies ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Abin
          wrote on last edited by
          #7

          yes, it has

          QT += widgets
          QT += network
          QT += sql

          But when I run from the Qt Creator it should be fine right? My plugin .pro file is

          @TEMPLATE = lib
          CONFIG += plugin
          QT += widgets
          QT += network
          QT += sql
          INCLUDEPATH += ../..
          HEADERS = serverplugin.h
          server.h
          serverdbmanager.h
          serverfunctionthread.h
          commondefenitions.h
          SOURCES = serverplugin.cpp
          server.cpp
          serverdbmanager.cpp
          serverfunctionthread.cpp
          TARGET = $$qtLibraryTarget(serverplugin)
          DESTDIR = ../plugins

          OTHER_FILES +=
          serverplugin.json
          @

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #8

            Did you check that you have all the needed Qt libraries deployed on your target ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Abin
              wrote on last edited by
              #9

              I did not get it... It would be helpful if you could explain a bit more... When I run it from Qt Creator do I have to worry about it? I should check it only while creating my executable package.. correct?

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #10

                If I understood you correctly, it only fails on android, right ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  Abin
                  wrote on last edited by
                  #11

                  No, when the below lines are executed the cases in windows and android ill explain

                  @bool pluginLoaded = pluginLoader.isLoaded();
                  QObject *plugin = pluginLoader.instance();
                  if (plugin)
                  {
                  m_pServerInterface = qobject_cast<ServerInterface *>(plugin);
                  if (NULL != m_pServerInterface)
                  {
                  qDebug() << Q_FUNC_INFO << "plugin loaded successfully";
                  }
                  else
                  {
                  qDebug() << Q_FUNC_INFO <<
                  "plugin object casted to "
                  "ServerInterface is Null";
                  }
                  }@

                  win:
                  pluginLoaded is false
                  *QObject plugin is not null and @qDebug() << Q_FUNC_INFO << "plugin loaded successfully";@ is executed
                  so able to call plugin functions

                  Android:
                  pluginLoaded is false
                  *QObject plugin is null
                  so not able to call plugin functions

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #12

                    Can you post the plugin header file ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      Abin
                      wrote on last edited by
                      #13

                      @#ifndef SERVERPLUGIN_H
                      #define SERVERPLUGIN_H

                      #include <QObject>
                      #include <QtPlugin>
                      #include "acepos/aceclient/serverinterface.h"

                      #include <QThread>
                      #include "server.h"

                      class ServerPlugin : public QObject,
                      public ServerInterface
                      {
                      Q_OBJECT
                      Q_PLUGIN_METADATA(IID "org.qt-project.Qt.AcePos.ServerInterface/1.0" FILE "serverplugin.json")
                      Q_INTERFACES(ServerInterface)
                      QThread *m_pServerThread;
                      Server *m_pServer;
                      callbackFunction m_callbackFunction;

                      public:
                      ServerPlugin():m_pServerThread(NULL), m_pServer(NULL){}

                      private slots:
                      void handleServiceStartNotify();

                      public:
                      bool startServerService(callbackFunction);
                      bool stopServerService();
                      };

                      #endif
                      @

                      1 Reply Last reply
                      0
                      • L Offline
                        L Offline
                        LeaA
                        wrote on last edited by
                        #14

                        Hi
                        Can you tell us how you solved this problem?

                        A 1 Reply Last reply
                        0
                        • L LeaA

                          Hi
                          Can you tell us how you solved this problem?

                          A Offline
                          A Offline
                          Abin
                          wrote on last edited by
                          #15

                          @LeaA
                          I didn't solve it.

                          L 1 Reply Last reply
                          0
                          • A Abin

                            @LeaA
                            I didn't solve it.

                            L Offline
                            L Offline
                            LeaA
                            wrote on last edited by
                            #16

                            @Abin

                            I solved it..
                            check the Q_OBJECT macro and the inheritance from QObject.

                            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