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

Impossible to deploy custom Qt plugins on Android correctly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.9.3
    • Build tools: qmake
    • None
    • * Host: Windows 10 64 bit
       * Qt 5.9.3 for Android ARMv7
       * NDK r16b
       * SDK 25.2.5
    • Android

    Description

      I use the QtC, and I want to create and use e.g. a custom Qt positioning plugin. So, I have created a simple project (please see in attachment). This works perfectly, e.g. on Windows, but on Android, this my plugin does not loaded.

      Content of plugin pro-file are following:

      include(../positionplugin.pri)
      
      QT += positioning
      TEMPLATE = lib
      CONFIG += plugin
      CONFIG -= app_bundle
      DESTDIR = $$top_builddir/deploy-apps/apps/position
      
      SOURCES += \
          fakegeopositioninfosource.cpp \
          fakegeopositioninfosourcefactory.cpp
      
      HEADERS += \
          fakegeopositioninfosource.h \
          fakegeopositioninfosourcefactory.h
      
      OTHER_FILES += \
          plugin.json
      
      ANDROID_EXTRA_PLUGINS += $$top_builddir/deploy-apps/apps/position
      

      and the positionplugin.pri file are following:

      include(../../common.pri)
      
      QT += positioning
      TEMPLATE = lib
      CONFIG += plugin link_prl
      CONFIG -= app_bundle
      DESTDIR = $$top_builddir/deploy-apps/apps/positioner
      

      and the common.pri file are following:

      TARGET = $$qtLibraryTarget($$TARGET)
      DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII QT_STRICT_ITERATORS
      CONFIG += c++14
      CONFIG(debug, debug|release):OBJECTS_DIR = debug
      CONFIG(release, debug|release):OBJECTS_DIR = release
      

      So, at compilation, my binary files (as an application, and as an plugin) are copies into:

      <shadow build dir>/deploy-apps/apps/libapp.so
      <shadow build dir>/deploy-apps/position/libfakeposition.so

      And next, when the APK creates, I see, that my plugin is in:

      <shadow build dir>/android-build/libs/armeabi-v7a/libfakeposition.so

      But, I also see, that all Qt-plugins in "android-build/libs/armeabi-v7a" directory now has a name's like "libplugins_<plugin type>_<plugin name>".

      So, I assume, that my plugin in "android-build/libs/armeabi-v7a" should contains a similar name: "libplugins_position_libfakeposition.so", but this does not happens.

      Also, I see that the "<shadow build dir>/android-build/res/values/libs.xml" file does not contain an entry about my plugin.

      I have read that I need to use the ANDROID_EXTRA_PLUGINS property in my plugin's pro file: http://doc.qt.io/qt-5/deployment-android.html

      but it has not any effect.

       

      PS: Also I have read this, https://stackoverflow.com/questions/47061829/how-to-deploy-qt-imageformats-plugins-on-android but it does not help too.

      Attachments

        1. qtbug65864.zip
          12 kB
          Denis Shienkov
        2. qtok65864.zip
          12 kB
          Denis Shienkov

        Issue Links

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

          Activity

            People

              taipan BogDan Vatra
              kuzulis Denis Shienkov
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes