Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.14.2, 5.15.1
-
None
-
Host system: Ubuntu 19.10
Targets tested: Android 5.0, Android 8.0
Description
Loading QML C++ extensions has been broken on Android with changes related to multi-arch build support.
The following change removed plugin extraction to the proper folder during build:
https://codereview.qt-project.org/c/qt/qtbase/+/270573
The following changes also affected it (the list might not be complete):
https://codereview.qt-project.org/c/qt/qtbase/+/273675
https://codereview.qt-project.org/c/qt/qtbase/+/265836
As a result plugin's folder is copied to android_build/lib as is, and is not picked up during packaging process. Moreover Qt now expects a different plugin's file naming. For example, prior to Qt 5.14 if the plugin's folder structure was the following
project_dir/qml/companyname/pluginname/libSomePlugin.so
and it was OK to deploy it using
ANDROID_EXTRA_PLUGINS += project_dir/qml QML_IMPORT_PATH += project_dir/qml
Now it does not work.
To workaround it I had to:
1) Fix plugins name the following way:
project_dir/qml/companyname/pluginname/libqml_companyname_pluginname_SomePlugin.so
2) Fix androideployqt tool, so that:
a) it copies my plugin to the same android_build/lib/$$ANDROID_TARGET_ARCH/ directory as other Qt and non-Qt libraries.
b) it adds my qmldir from project_dir/qml/companyname/pluginname/ directory to android_build_/assets/android_rcc_bundle/android_rcc_bundle.qrc so that it is now compiled into resources as well.
I have not found any updated documentation on how to do it properly and I believe this has been broken.