Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt MQTT-Module for Android
Forum Updated to NodeBB v4.3 + New Features

Qt MQTT-Module for Android

Scheduled Pinned Locked Moved Solved Mobile and Embedded
7 Posts 4 Posters 834 Views
  • 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.
  • P Offline
    P Offline
    Peter76
    wrote on last edited by
    #1

    A few days ago I created the Qt MQTT module for Linux X86_64bit.
    That worked perfectly. I can easily use the module in Qt Creator.

    Now I want to create the module for Android. Unfortunately that doesn't work.
    I did the following:

    First I have the sources with the console call
    "sudo git clone git://code.qt.io/qt/qtmqtt.git --branch 5.14.2"
    downloaded to the following folder "/opt/Qt5.14.2/5.14.2"

    This created the folder "qtmqtt"
    In this folder I created the folder "build".
    From the "build" folder I called "qmake" as follows
    "sudo /opt/Qt5.14.2/5.14.2/android/bin/qmake -r .."

    Now the module should be created. But that doesn't happen!
    Instead I get the following error message:

    "Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.
    Could not read qmake configuration file /opt/Qt5.14.2/5.14.2/android/mkspecs/android-clang/qmake.conf.
    Error processing project file: ../qtmqtt.pro"

    I then tried to export the variable "ANDROID_NDK_ROOT".
    For this I proceeded as follows:
    "export ANDROID_NDK_ROOT="/opt/android_sdk/ndk/21.3.6528147"
    That probably worked. Because the query "echo $ANDROID_NDK_ROOT"
    returns "/opt/android_sdk/ndk/21.3.6528147"

    But after calling "qmake" as described above, I get the same error message again.

    "Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.
    Could not read qmake configuration file /opt/Qt5.14.2/5.14.2/android/mkspecs/android-clang/qmake.conf.
    Error processing project file: ../qtmqtt.pro"

    I can not explain it. In Qt Creator I can create Android projects without any problems.

    What am I doing wrong? Can someone help me?
    I have found some posts on this topic on the internet, but no answer that worked for me.

    JoeCFDJ 1 Reply Last reply
    0
    • P Peter76

      A few days ago I created the Qt MQTT module for Linux X86_64bit.
      That worked perfectly. I can easily use the module in Qt Creator.

      Now I want to create the module for Android. Unfortunately that doesn't work.
      I did the following:

      First I have the sources with the console call
      "sudo git clone git://code.qt.io/qt/qtmqtt.git --branch 5.14.2"
      downloaded to the following folder "/opt/Qt5.14.2/5.14.2"

      This created the folder "qtmqtt"
      In this folder I created the folder "build".
      From the "build" folder I called "qmake" as follows
      "sudo /opt/Qt5.14.2/5.14.2/android/bin/qmake -r .."

      Now the module should be created. But that doesn't happen!
      Instead I get the following error message:

      "Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.
      Could not read qmake configuration file /opt/Qt5.14.2/5.14.2/android/mkspecs/android-clang/qmake.conf.
      Error processing project file: ../qtmqtt.pro"

      I then tried to export the variable "ANDROID_NDK_ROOT".
      For this I proceeded as follows:
      "export ANDROID_NDK_ROOT="/opt/android_sdk/ndk/21.3.6528147"
      That probably worked. Because the query "echo $ANDROID_NDK_ROOT"
      returns "/opt/android_sdk/ndk/21.3.6528147"

      But after calling "qmake" as described above, I get the same error message again.

      "Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.
      Could not read qmake configuration file /opt/Qt5.14.2/5.14.2/android/mkspecs/android-clang/qmake.conf.
      Error processing project file: ../qtmqtt.pro"

      I can not explain it. In Qt Creator I can create Android projects without any problems.

      What am I doing wrong? Can someone help me?
      I have found some posts on this topic on the internet, but no answer that worked for me.

      JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by JoeCFD
      #2

      @Peter76 can you display your Android tab on Qt Creator?
      Do not you need to build MQTT as well for Android?

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Peter76
        wrote on last edited by
        #3

        @ JoeCFD
        Thank you for your reply,

        I'm not sure if you understood my question correctly.
        Of course I want to create the module for Android. That's what my post is about!
        However, like the modules for the X86_64 and ARM architectures, I want to compile
        the module from the console and NOT using the Qt Creator.

        Attached you will find the requested screenshot.Android.PNG

        JoeCFDJ 1 Reply Last reply
        0
        • P Peter76

          @ JoeCFD
          Thank you for your reply,

          I'm not sure if you understood my question correctly.
          Of course I want to create the module for Android. That's what my post is about!
          However, like the modules for the X86_64 and ARM architectures, I want to compile
          the module from the console and NOT using the Qt Creator.

          Attached you will find the requested screenshot.Android.PNG

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by JoeCFD
          #4

          @Peter76
          You use sudo to build the module because you installed everything into root. JDK under root may be OK. But it may be easier for you to install android sdk under your home dir in order to select Android Package from SDK Manager Tab without root privilege. Then you can build the module with Qt Creator without sudo.

          I installed both JDK and android sdk under my home dir and do not need sudo for any build.

          1 Reply Last reply
          0
          • P Peter76 has marked this topic as solved on
          • P Offline
            P Offline
            Peter76
            wrote on last edited by
            #5

            @JoeCFD
            You didn't answer my question, but you gave me a valuable hint to solve the problem. Thank You.

            I compiled the sources as described above without sudo in a folder in my home directory. That worked.

            _ 1 Reply Last reply
            0
            • P Peter76

              @JoeCFD
              You didn't answer my question, but you gave me a valuable hint to solve the problem. Thank You.

              I compiled the sources as described above without sudo in a folder in my home directory. That worked.

              _ Offline
              _ Offline
              _why_n0t
              wrote on last edited by
              #6

              @Peter76 I have the same problem with you. Can you tell me what did you do to solve the problem?

              jsulmJ 1 Reply Last reply
              0
              • _ _why_n0t

                @Peter76 I have the same problem with you. Can you tell me what did you do to solve the problem?

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @_why_n0t said in Qt MQTT-Module for Android:

                Can you tell me what did you do to solve the problem?

                He did in the last sentence...

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                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