Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-83273

QML C++ extension plugins loading is broken on Android by multi-arch support's build changes

    XMLWordPrintable

Details

    • Android

    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.

       
       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtandroidteam Qt Android Team
            rightaway717 Ivan Belyakov
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes