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

Cannot use deployment-dependencies with QtNfc

    XMLWordPrintable

Details

    • Android
    • 2024wk2XFOQtforAndroid

    Description

      We provide an SDK as AAR from our application. So this AAR shouldn't provide any GUI-related libraries. But libplugins_platforms_qtforandroid requires Qt6Gui with a lot of imageformats and iconengines with Qt6Svg.

      So we tried to add custom property "deployment-dependencies".

         "deployment-dependencies": "lib/libQt6Core_armeabi-v7a.so,lib/libQt6Network_armeabi-v7a.so,lib/libQt6Concurrent_armeabi-v7a.so,lib/libQt6StateMachine_armeabi-v7a.so,lib/libQt6Gui_armeabi-v7a.so,lib/libQt6WebSockets_armeabi-v7a.so,lib/libQt6Nfc_armeabi-v7a.so,lib/libcrypto_armeabi-v7a.so,lib/libssl_armeabi-v7a.so,plugins/networkinformation/libplugins_networkinformation_qandroidnetworkinformation_armeabi-v7a.so,plugins/tls/libplugins_tls_qopensslbackend_armeabi-v7a.so,plugins/platforms/libplugins_platforms_qtforandroid_armeabi-v7a.so,jar/Qt6Android.jar,jar/Qt6AndroidNetwork.jar,jar/Qt6AndroidNetworkInformationBackend.jar,jar/Qt6AndroidNfc.jar",
      

      It will add all .so and .jars but it misses to add the required "static_init_classes" for QtNfc in "res/values/libs.xml":

      <string name="static_init_classes"></string>
      
      Should be:
      <string name="static_init_classes">org.qtproject.qt.android.nfc.QtNfc</string>
      

      Qt6Nfc_armeabi-v7a-android-dependencies.xml

      <rules><dependencies>
      <lib name="Qt6Nfc_armeabi-v7a"><depends>
      <jar bundling="1" file="jar/Qt6AndroidNfc.jar" initClass="org.qtproject.qt.android.nfc.QtNfc" />
      <permission name="android.permission.NFC" />
      </depends></lib>
      </dependencies></rules>% 
      

      It seems it is impossible to set static_init_classes by itself as it is not possible to add the whole xml file.

      "deployment-dependencies": "...,lib/Qt6Nfc_armeabi-v7a-android-dependencies.xml,",
      

      Maybe it would be better to add an "exclude" entry for androideployqt to use automatic collection but avoid some libraries/plugins? That would be easier.

      Attachments

        Issue Links

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

          Activity

            People

              qtandroidteam Qt Android Team
              misery André Klitzing
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes