Plugin verification data mismatch error on my plugin load
-
Does your plugin have any dependencies ?
-
yes, it has
QT += widgets
QT += network
QT += sqlBut 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 = ../pluginsOTHER_FILES +=
serverplugin.json
@ -
Did you check that you have all the needed Qt libraries deployed on your target ?
-
If I understood you correctly, it only fails on android, right ?
-
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 functionsAndroid:
pluginLoaded is false
*QObject plugin is null
so not able to call plugin functions -
Can you post the plugin header file ?
-
@#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
@