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

Unused libs placed into app package

XMLWordPrintable

    • Android

      I've noticed that some unused Qt shared libs are bundled into app package, increasing its size, i dint find any documented way to exclude them from being bundled into APK, e.g:

      libQt6QuickControls2Basic_arm64-v8a.so
      libQt6QuickControls2BasicStyleImpl_arm64-v8a.so
      libqml_QtQuick_Controls_Basic_qtquickcontrols2basicstyleplugin_arm64-v8a.so
      libqml_QtQuick_Controls_Basic_impl_qtquickcontrols2basicstyleimplplugin_arm64-v8a.so
      libQt6QmlModels_arm64-v8a.so
      libqml_QtQml_Models_modelsplugin_arm64-v8a.so
      libqml_Qt_labs_qmlmodels_labsmodelsplugin_arm64-v8a.so
      libQt6QuickTemplates2_arm64-v8a.so
      libqml_QtQuick_Templates_qtquicktemplates2plugin_arm64-v8a.so

      -while only 'Material' style used in project and nothing from models are used. Also libQt6Network_arm64-v8a.so (1.7 MB) are always bundled, which i don't use anywhere directly in code.

      As of Qt 6.7/6.8/6.9 there is qt_import_plugins() CMake command, which can be used to exclude few unused things, but not all of them

      qt_import_plugins(app
        INCLUDE_BY_TYPE imageformats Qt6::QSvgPlugin
        EXCLUDE_BY_TYPE qmltooling tls iconengines networkinformation
      )
      

      That's kinda other topic, but: biggest lib is libQt6Gui_arm64-v8a.so (7.5 MB) maybe there could be optional shredded/lighter versions of it for deployment Android/IOS targets.

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

            qtbuildsystem Qt Build System Team
            morte Maxim Bescherevnykh
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes