From a9c8870b5e6eddc31b78b7e4afe46b28110e7863 Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Tue, 14 Mar 2023 23:32:03 +0200 Subject: [PATCH] Android: demistify the "No platform plugin" androiddeployqt error Make the error message clearly mention that a Qt for Android app require linking to Qt Gui library. Along the way get rid of the libqtforandroidGL mention which was valid when Qt for Android had separate plugins for raster and opengl, which was removed some time ago in 8a9bd001c947e6888d37e99fc456339fd2b51b36. Pick-to: 6.5 6.4 6.2 5.15 Task-number: QTBUG-111933 Task-number: QTBUG-111934 Task-number: QTBUG-108643 Task-number: QTBUG-97636 Task-number: QTBUG-83997 Fixes: QTBUG-85544 Task-number: QTBUG-93185 Change-Id: I24f6c08f619d805e0d82758d35aebaf32038206c Reviewed-by: Alexandru Croitor --- src/tools/androiddeployqt/main.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 1496b391f03..e6e8e4aa7a0 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -1591,15 +1591,9 @@ bool updateLibsXml(Options *options) if (localLibs.isEmpty()) { QString plugin; for (const QtDependency &qtDependency : options->qtDependencies[it.key()]) { - if (qtDependency.relativePath.endsWith("libqtforandroid.so"_L1) - || qtDependency.relativePath.endsWith("libqtforandroidGL.so"_L1)) { - if (!plugin.isEmpty() && plugin != qtDependency.relativePath) { - fprintf(stderr, "Both platform plugins libqtforandroid.so and libqtforandroidGL.so included in package. Please include only one.\n"); - return false; - } - + if (qtDependency.relativePath.endsWith("libqtforandroid.so"_L1)) plugin = qtDependency.relativePath; - } + if (qtDependency.relativePath.contains( QString::asprintf("libQt%dOpenGL", QT_VERSION_MAJOR)) || qtDependency.relativePath.contains( @@ -1611,7 +1605,8 @@ bool updateLibsXml(Options *options) if (plugin.isEmpty()) { fflush(stdout); - fprintf(stderr, "No platform plugin, neither libqtforandroid.so or libqtforandroidGL.so, included in package. Please include one.\n"); + fprintf(stderr, "No platform plugin (libqtforandroid.so) included in " + "the deployment. Make sure the app links to Qt Gui library.\n"); fflush(stderr); return false; }