Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.9.0 Beta 1
-
None
-
-
5
-
1ff82d1ebaa7b9151bab449fd29b76d59654037b (qt/qtbase/dev) f7857d7f867ae5be0f910f802daaf4cec69c8a58 (qt/qtbase/5.15)
-
Da Vinci sprint 10, Da Vinci sprint 11
Description
Qt documentation is actually:
ANDROID_EXTRA_PLUGINS: This variable can be used to specify different resources that your project has to bundle but cannot be delivered through the assets system, such as qml plugins. When using this variable, androiddeployqt will make sure everything is packaged and deployed properly.
But it doesn't explain we have to give a path of a directory hierarchy similar to the Qt plugin directory. For example to add an sqldriver, we have to provide this directory hierarchy : plugins/sqldrivers/libqXXX.so
Also, it doesn't explain the filename mangling libplugins_sqldrivers_libqsqlite.so which is later copied to plugins/sqldrivers/libqsqlite.so
Corresponding code is:
bool copyAndroidExtraResources(const Options &options) { if (options.extraPlugins.isEmpty()) return true; if (options.verbose) fprintf(stdout, "Copying %d external resources to package.\n", options.extraPlugins.size()); for (const QString &extraResource : options.extraPlugins) { QFileInfo extraResourceInfo(extraResource); if (!extraResourceInfo.exists() || !extraResourceInfo.isDir()) { fprintf(stderr, "External resource %s does not exist or not a correct directory!\n", qPrintable(extraResource)); return false; } QDir resourceDir(extraResource); QString assetsDir = options.outputDirectory + QStringLiteral("/assets/") + resourceDir.dirName() + QLatin1Char('/'); QString libsDir = options.outputDirectory + QStringLiteral("/libs/") + options.architecture + QLatin1Char('/'); const QStringList files = allFilesInside(resourceDir, resourceDir); for (const QString &resourceFile : files) { QString originFile(resourceDir.filePath(resourceFile)); QString destinationFile; if (!resourceFile.endsWith(QLatin1String(".so"))) { destinationFile = assetsDir + resourceFile; } else { destinationFile = libsDir + QStringLiteral("/lib") + QString(resourceDir.dirName() + QLatin1Char('/') + resourceFile).replace(QLatin1Char('/'), QLatin1Char('_')); } if (!copyFileIfNewer(originFile, destinationFile, options.verbose)) return false; } } return true; }
Attachments
Issue Links
- is required for
-
QTBUG-72141 Qt for Android integration cannot be used for complex QML apps
-
- Closed
-
- relates to
-
QTBUG-65864 Impossible to deploy custom Qt plugins on Android correctly
-
- Closed
-
- mentioned in
-
Page Loading...
For Gerrit Dashboard: QTBUG-60022 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
302591,6 | Doc: Improve documentation of ANDROID_EXTRA_PLUGINS qmake variable | dev | qt/qtbase | Status: MERGED | +2 | 0 |
311399,2 | Doc: Improve documentation of ANDROID_EXTRA_PLUGINS qmake variable | 5.15 | qt/qtbase | Status: MERGED | +2 | 0 |