Qt MQTT-Module for Android
-
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. -
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. -
@ 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.
-
@ 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.
@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.
-
-
@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.
-
@Peter76 I have the same problem with you. Can you tell me what did you do to solve the problem?
@_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...