Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QtLocation and QtPositioning modules are not installed...
Forum Updated to NodeBB v4.3 + New Features

QtLocation and QtPositioning modules are not installed...

Scheduled Pinned Locked Moved Solved QML and Qt Quick
16 Posts 3 Posters 6.7k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Gourmet

    @sierdzio

    • 5.12.5
    • yes
    • not yet tried
    J.HilkJ Offline
    J.HilkJ Offline
    J.Hilk
    Moderators
    wrote on last edited by
    #4

    @Gourmet have you added the requieret permissions in your manifest file and requested them (during runtime)


    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


    Q: What's that?
    A: It's blue light.
    Q: What does it do?
    A: It turns blue.

    1 Reply Last reply
    0
    • G Gourmet

      @sierdzio

      • 5.12.5
      • yes
      • not yet tried
      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #5

      @Gourmet said in QtLocation and QtPositioning modules are not installed...:

      @sierdzio

      • 5.12.5
      • yes
      • not yet tried

      OK, please try on desktop first. If it works, then it's something about Android. If it does not work, then the issue is with your code or installation (or a bug in Qt).

      (Z(:^

      G 1 Reply Last reply
      0
      • sierdzioS sierdzio

        @Gourmet said in QtLocation and QtPositioning modules are not installed...:

        @sierdzio

        • 5.12.5
        • yes
        • not yet tried

        OK, please try on desktop first. If it works, then it's something about Android. If it does not work, then the issue is with your code or installation (or a bug in Qt).

        G Offline
        G Offline
        Gourmet
        wrote on last edited by Gourmet
        #6

        @sierdzio this is not about Android definitely. Those modules must be provided with Qt but they are not.

        PS: In my Kubuntu 18.04 LTS this error does not appear. Map works (I had small error in QML structure but fixed it). That means QML location and positioning modules for Kubuntu exist.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          Gourmet
          wrote on last edited by
          #7

          I found that two shared Qt libraries are not copied to app building directory. They exist in Qt distribution structure:

          ~/Qt5/5.12.5/5.12.5/android_armv7/qml/QtLocation/libdeclarative_location.so
          ~/Qt5/5.12.5/5.12.5/android_armv7/qml/QtPositioning/libdeclarative_positioning.so

          They must be copied to

          <build-dir>/android-build/libs/armeabi-v7a/libqml_QtLocation_libdeclarative_location.so
          <build-dir>/android-build/libs/armeabi-v7a/libqml_QtPositioning_libdeclarative_positioning.so

          while building APK. But they are not. The bug is somewhere in Qt configuration files.

          J.HilkJ 1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #8

            Try with Qt 5.13.1 and if it's not fixed there, please fill in a bug report.

            (Z(:^

            1 Reply Last reply
            0
            • G Gourmet

              I found that two shared Qt libraries are not copied to app building directory. They exist in Qt distribution structure:

              ~/Qt5/5.12.5/5.12.5/android_armv7/qml/QtLocation/libdeclarative_location.so
              ~/Qt5/5.12.5/5.12.5/android_armv7/qml/QtPositioning/libdeclarative_positioning.so

              They must be copied to

              <build-dir>/android-build/libs/armeabi-v7a/libqml_QtLocation_libdeclarative_location.so
              <build-dir>/android-build/libs/armeabi-v7a/libqml_QtPositioning_libdeclarative_positioning.so

              while building APK. But they are not. The bug is somewhere in Qt configuration files.

              J.HilkJ Offline
              J.HilkJ Offline
              J.Hilk
              Moderators
              wrote on last edited by
              #9

              @Gourmet
              you said, this is your own app,

              can you try one of the examples that come with QtCreator and test if it's the same issue for those ?

              https://doc-snapshots.qt.io/qt5-5.13/qtlocation-examples.html


              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              G 1 Reply Last reply
              1
              • J.HilkJ J.Hilk

                @Gourmet
                you said, this is your own app,

                can you try one of the examples that come with QtCreator and test if it's the same issue for those ?

                https://doc-snapshots.qt.io/qt5-5.13/qtlocation-examples.html

                G Offline
                G Offline
                Gourmet
                wrote on last edited by Gourmet
                #10

                @J-Hilk said in QtLocation and QtPositioning modules are not installed...:

                @Gourmet
                you said, this is your own app,

                can you try one of the examples that come with QtCreator and test if it's the same issue for those ?

                https://doc-snapshots.qt.io/qt5-5.13/qtlocation-examples.html

                The Map Viewer on Android tells "The active map type requires (missing) SSL". The map is gray, no tiles. But both files missing in my project - here in building example directory exist. I see difference in project files - the undocumented option QT_FOR_CONFIG += location-private with comment # Workaround for QTBUG-38735. Let's try add it to my project...

                G 1 Reply Last reply
                0
                • G Gourmet

                  @J-Hilk said in QtLocation and QtPositioning modules are not installed...:

                  @Gourmet
                  you said, this is your own app,

                  can you try one of the examples that come with QtCreator and test if it's the same issue for those ?

                  https://doc-snapshots.qt.io/qt5-5.13/qtlocation-examples.html

                  The Map Viewer on Android tells "The active map type requires (missing) SSL". The map is gray, no tiles. But both files missing in my project - here in building example directory exist. I see difference in project files - the undocumented option QT_FOR_CONFIG += location-private with comment # Workaround for QTBUG-38735. Let's try add it to my project...

                  G Offline
                  G Offline
                  Gourmet
                  wrote on last edited by
                  #11

                  Nope... did not help.

                  1 Reply Last reply
                  0
                  • sierdzioS Offline
                    sierdzioS Offline
                    sierdzio
                    Moderators
                    wrote on last edited by
                    #12

                    You need to add OpenSSL.

                    (Z(:^

                    G 1 Reply Last reply
                    2
                    • sierdzioS sierdzio

                      You need to add OpenSSL.

                      G Offline
                      G Offline
                      Gourmet
                      wrote on last edited by Gourmet
                      #13

                      @sierdzio probably then Map Viewer will work. To console it does not tell anything about non-installed modules - as I said in my first message. And module copies are in it's building directory. Now I have find why they do not copy in my project. I have all QT += options as required:

                      QT += core gui svg quick quickwidgets qml network positioning location sensors

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        Gourmet
                        wrote on last edited by Gourmet
                        #14

                        I suppose the problem appears cause I use both QML location/positioning and C++ Qt-functions in one app. On the QT += location switch it copies C++ library - without it I cannot assemble project. But then it forgets about QML library.

                        1 Reply Last reply
                        0
                        • G Offline
                          G Offline
                          Gourmet
                          wrote on last edited by Gourmet
                          #15

                          The solution found.

                          Qt for Android has bug. To find which QML library must be included into APK it scans QML files by utility qmlimportscanner. The bug is in the fact that it scans only QML files in head project. If QML files are used in subprojects - they are not scanned. I use QML Map in subproject - this is mandatory needed by task.

                          Solution - just enough include to head project the dummy.qml file with content:

                          import QtQuick 2.0
                          import QtPositioning 5.8 // any other version as needed
                          import QtLocation 5.11 // any other version as needed
                          
                          Item {
                          
                          }
                          

                          It better add by Add New.../Choose a template/Qt/QML File (Qt Quick 2). I do not know when and how qmlimportscanner is called therefore I added dummy.qml to resources root.

                          After build both absent libs appear in <build-dir>/android-build/libs/armeabi-v7a folder. Application runs on Android device without error messages shown in first my message.

                          J.HilkJ 1 Reply Last reply
                          1
                          • G Gourmet

                            The solution found.

                            Qt for Android has bug. To find which QML library must be included into APK it scans QML files by utility qmlimportscanner. The bug is in the fact that it scans only QML files in head project. If QML files are used in subprojects - they are not scanned. I use QML Map in subproject - this is mandatory needed by task.

                            Solution - just enough include to head project the dummy.qml file with content:

                            import QtQuick 2.0
                            import QtPositioning 5.8 // any other version as needed
                            import QtLocation 5.11 // any other version as needed
                            
                            Item {
                            
                            }
                            

                            It better add by Add New.../Choose a template/Qt/QML File (Qt Quick 2). I do not know when and how qmlimportscanner is called therefore I added dummy.qml to resources root.

                            After build both absent libs appear in <build-dir>/android-build/libs/armeabi-v7a folder. Application runs on Android device without error messages shown in first my message.

                            J.HilkJ Offline
                            J.HilkJ Offline
                            J.Hilk
                            Moderators
                            wrote on last edited by
                            #16

                            @Gourmet said in QtLocation and QtPositioning modules are not installed...:

                            I use QML Map in subproject

                            That's actually an important piece of information!
                            Glad it's now working for you, and thanks for sharing the answer!


                            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                            Q: What's that?
                            A: It's blue light.
                            Q: What does it do?
                            A: It turns blue.

                            1 Reply Last reply
                            0

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved