qtmqtt based android Dashboard



  • Hi, I have been trying to implement a MQTT Dashboard to communicate with one of those esp8266 modules and so far I managed to do it while compiling for my desktop, I just thought I could take advantage of the multiple platform support that Qt offers, anyway, I downloaded the armeabi-v7a android related components for qt and tried to build my application, at first I got an error related to the missing mqtt module, I figured that I didn't build the library for armv7a, so I tried and got the following :

    20:38:31: Running steps for project qtmqtt...
    20:38:31: Starting: "/opt/Qt/5.12.4/android_armv7/bin/qmake" /home/lopeztel/Qt/qtmqtt/src/mqtt/mqtt.pro -spec android-clang CONFIG+=debug CONFIG+=qml_debug
    Info: creating stash file /home/lopeztel/Qt/build-qtmqtt-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Debug/.qmake.stash
    Project MESSAGE: perl -w /opt/Qt/5.12.4/android_armv7/bin/syncqt.pl -module QtMqtt -version 5.12.4 -outdir /home/lopeztel/Qt/build-qtmqtt-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Debug -builddir /home/lopeztel/Qt/build-qtmqtt-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Debug /home/lopeztel/Qt/qtmqtt
    <srcbase> = /home/lopeztel/Qt/qtmqtt 
    <bldbase> = /home/lopeztel/Qt/build-qtmqtt-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Debug 
    <outbase> = /home/lopeztel/Qt/build-qtmqtt-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Debug 
    QtMqtt: created fwd-include header(s) for <srcbase>/src/mqtt/ { qmqttauthenticationproperties.h (2), qmqttclient.h (2), qmqttclient_p.h (1), qmqttconnection_p.h (1), qmqttconnectionproperties.h (4), qmqttconnectionproperties_p.h (1), qmqttcontrolpacket_p.h (1), qmqttglobal.h (1), qmqttmessage.h (2), qmqttmessage_p.h (1), qmqttpublishproperties.h (3), qmqttpublishproperties_p.h (1), qmqttsubscription.h (2), qmqttsubscription_p.h (1), qmqttsubscriptionproperties.h (3), qmqtttopicfilter.h (2), qmqtttopicname.h (2), qmqtttype.h (3) }
    QtMqtt: created version header
    QtMqtt: created master header
    QtMqtt: created headers.pri file
    20:38:31: The process "/opt/Qt/5.12.4/android_armv7/bin/qmake" exited normally.
    20:38:31: Starting: "/home/lopeztel/android-ndk-r19c-linux-x86_64/android-ndk-r19c/prebuilt/linux-x86_64/bin/make" -f /home/lopeztel/Qt/build-qtmqtt-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Debug/src/mqtt/Makefile qmake_all
    
    ... Not may errors here ... edited to shorten the post
    
    rm -f ../../lib/libQt5Mqtt.so
    mv -f libQt5Mqtt.so ../../lib/libQt5Mqtt.so
    20:38:37: The process "/home/lopeztel/android-ndk-r19c-linux-x86_64/android-ndk-r19c/prebuilt/linux-x86_64/bin/make" exited normally.
    20:38:37: Starting: "/home/lopeztel/android-ndk-r19c-linux-x86_64/android-ndk-r19c/prebuilt/linux-x86_64/bin/make" INSTALL_ROOT=/home/lopeztel/Qt/build-qtmqtt-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Debug/android-build install
    make: *** No rule to make target `install'.  Stop.
    20:38:37: The process "/home/lopeztel/android-ndk-r19c-linux-x86_64/android-ndk-r19c/prebuilt/linux-x86_64/bin/make" exited with code 2.
    Error while building/deploying project qtmqtt (kit: Android for armeabi-v7a (Clang Qt 5.12.4 for Android ARMv7))
    When executing step "Copy application data"
    20:38:37: Elapsed time: 00:06.
    

    From my limited understanding I figured that the only missing step was copying the corresponding .so files to my Qt installation directory, so I ran sudo make install and apparently the files were copied:

    lopeztel@lopeztel-Inspiron-13-7359:~/Qt/build-qtmqtt-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Debug/src/mqtt$ sudo make install
    [sudo] password for lopeztel: 
    /opt/Qt/5.12.4/android_armv7/bin/qmake -install qinstall -exe ../../lib/libQt5Mqtt.so /opt/Qt/5.12.4/android_armv7/lib/libQt5Mqtt.so
     ...
    
    

    Now, the fun part begins, I don"t get the error complaining about the missing mqtt module when building my MQTT Dashboard porject but I had to comment out the virtual keyboard support, some error about not knowing what it was... Also, this is my output after building, there are some warnings about not being able to find some QML imports:

    20:48:12: Running steps for project MQTT_Dashboard...
    20:48:12: Configuration unchanged, skipping qmake step.
    20:48:12: Starting: "/home/lopeztel/android-ndk-r19c-linux-x86_64/android-ndk-r19c/prebuilt/linux-x86_64/bin/make" -j4
    Makefile:691: warning: overriding commands for target `main_qml.cpp'
    Makefile:687: warning: ignoring old commands for target `main_qml.cpp'
    
    ...
    
      Output directory: /home/lopeztel/Qt/Projects/build-MQTT_Dashboard-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Release/android-build/
      Application binary: /home/lopeztel/Qt/Projects/build-MQTT_Dashboard-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Release/libMQTT_Dashboard.so
      Android build platform: android-29
      Install to device: No
    Warning: QML import could not be resolved in any of the import paths: MqttClient
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Imagine.impl
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.impl
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Universal.impl
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Fusion.impl
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Material.impl
      -- Skipping /opt/Qt/5.12.4/android_armv7/plugins/iconengines/libqsvgicon.so. It has unmet dependencies: lib/libQt5Svg.so.
      -- Skipping /opt/Qt/5.12.4/android_armv7/plugins/imageformats/libqsvg.so. It has unmet dependencies: lib/libQt5Svg.so.
    :checkDebugClasspath UP-TO-DATE
    :preBuild UP-TO-DATE
    :preDebugBuild UP-TO-DATE
    :compileDebugAidl UP-TO-DATE
    :compileDebugRenderscript UP-TO-DATE
    :checkDebugManifest UP-TO-DATE
    :generateDebugBuildConfig UP-TO-DATE
    :prepareLintJar UP-TO-DATE
    :mainApkListPersistenceDebug UP-TO-DATE
    :generateDebugResValues UP-TO-DATE
    :generateDebugResources UP-TO-DATE
    :mergeDebugResources UP-TO-DATE
    :createDebugCompatibleScreenManifests UP-TO-DATE
    :processDebugManifest UP-TO-DATE
    :splitsDiscoveryTaskDebug UP-TO-DATE
    :processDebugResources UP-TO-DATE
    :generateDebugSources UP-TO-DATE
    :javaPreCompileDebug UP-TO-DATE
    :compileDebugJavaWithJavac UP-TO-DATE
    :compileDebugNdk NO-SOURCE
    :compileDebugSources UP-TO-DATE
    :mergeDebugShaders UP-TO-DATE
    :compileDebugShaders UP-TO-DATE
    :generateDebugAssets UP-TO-DATE
    :mergeDebugAssets UP-TO-DATE
    :transformClassesWithDexBuilderForDebug UP-TO-DATE
    :transformDexArchiveWithExternalLibsDexMergerForDebug UP-TO-DATE
    :transformDexArchiveWithDexMergerForDebug UP-TO-DATE
    :mergeDebugJniLibFolders UP-TO-DATE
    :transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE
    :checkDebugLibraries UP-TO-DATE
    :processDebugJavaRes NO-SOURCE
    :transformResourcesWithMergeJavaResForDebug UP-TO-DATE
    :validateSigningDebug UP-TO-DATE
    :packageDebug UP-TO-DATE
    :assembleDebug UP-TO-DATE
    
    BUILD SUCCESSFUL in 6s
    28 actionable tasks: 28 up-to-date
    Android package built successfully in 7.465 ms.
      -- File: /home/lopeztel/Qt/Projects/build-MQTT_Dashboard-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Release/android-build//build/outputs/apk/debug/android-build-debug.apk
    20:48:21: The process "/opt/Qt/5.12.4/android_armv7/bin/androiddeployqt" exited normally.
    20:48:21: Elapsed time: 00:09.
    

    Apparently the warnings don't prevent the build from happening but when I deploy to my phone the application opens and closes instantly so I know something is wrong, I just can't figure out why ...

    here's the deploy log if it's of any use:

    Initializing deployment to Android device/simulator
    Deploying to ZY223NNPZZ
    20:53:09: Running steps for project MQTT_Dashboard...
    20:53:09: Configuration unchanged, skipping qmake step.
    20:53:09: Starting: "/home/lopeztel/android-ndk-r19c-linux-x86_64/android-ndk-r19c/prebuilt/linux-x86_64/bin/make" -j4
    Makefile:691: warning: overriding commands for target `main_qml.cpp'
    Makefile:687: warning: ignoring old commands for target `main_qml.cpp'
    
    ... Pretty much the same as build
    
    BUILD SUCCESSFUL in 6s
    28 actionable tasks: 28 up-to-date
    Android package built successfully in 7.034 ms.
      -- File: /home/lopeztel/Qt/Projects/build-MQTT_Dashboard-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Release/android-build//build/outputs/apk/debug/android-build-debug.apk
    20:53:16: The process "/opt/Qt/5.12.4/android_armv7/bin/androiddeployqt" exited normally.
    20:53:16: Starting: "/opt/Qt/5.12.4/android_armv7/bin/androiddeployqt" --verbose --output /home/lopeztel/Qt/Projects/build-MQTT_Dashboard-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Release/android-build --no-build --input /home/lopeztel/Qt/Projects/build-MQTT_Dashboard-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Release/android-libMQTT_Dashboard.so-deployment-settings.json --gradle --reinstall --device ZY223NNPZZ
    Generating Android Package
      Input file: /home/lopeztel/Qt/Projects/build-MQTT_Dashboard-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Release/android-libMQTT_Dashboard.so-deployment-settings.json
      Output directory: /home/lopeztel/Qt/Projects/build-MQTT_Dashboard-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Release/android-build/
      Application binary: /home/lopeztel/Qt/Projects/build-MQTT_Dashboard-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Release/libMQTT_Dashboard.so
      Android build platform: android-29
      Install to device: ZY223NNPZZ
    Detecting dependencies of application.
    Reading dependencies from /home/lopeztel/Qt/Projects/build-MQTT_Dashboard-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Release/libMQTT_Dashboard.so
          lib/libQt5Charts.so
          lib/libQt5Core.so
          lib/libQt5Gui.so
          lib/libQt5Mqtt.so
          lib/libQt5Network.so
          lib/libQt5Qml.so
          lib/libQt5Quick.so
          lib/libQt5Widgets.so
    Reading dependencies from /opt/Qt/5.12.4/android_armv7/lib/libQt5Charts.so
          lib/libQt5Core.so
          lib/libQt5Gui.so
          lib/libQt5Widgets.so
    Reading dependencies from /opt/Qt/5.12.4/android_armv7/lib/libQt5Core.so
    Appending dependency: lib/libQt5Core.so
    Reading dependencies from /opt/Qt/5.12.4/android_armv7/lib/libQt5Gui.so
          lib/libQt5Core.so
    Appending dependency: lib/libQt5Gui.so
    Reading dependencies from /opt/Qt/5.12.4/android_armv7/lib/libQt5Widgets.so
          lib/libQt5Core.so
          lib/libQt5Gui.so
    Appending dependency: lib/libQt5Widgets.so
    Reading Android dependencies for Qt5Core
    Reading Android dependencies for Qt5Gui
    Appending dependency from xml: plugins/platforms/android/libqtforandroid.so
    
    ..pretty much appernding dependencies
    
      
    Reading dependencies from /opt/Qt/5.12.4/android_armv7/qml/QtGraphicalEffects/private/libqtgraphicaleffectsprivate.so
          lib/libQt5Core.so
          lib/libQt5Gui.so
          lib/libQt5Network.so
          lib/libQt5Qml.so
          lib/libQt5Quick.so
        -- Appending dependency found by qmlimportscanner: /opt/Qt/5.12.4/android_armv7/qml/QtGraphicalEffects/private/qmldir
        -- Appending dependency found by qmlimportscanner: /opt/Qt/5.12.4/android_armv7/qml/QtGraphicalEffects/qmldir
        -- Appending dependency found by qmlimportscanner: /opt/Qt/5.12.4/android_armv7/qml/QtGraphicalEffects/RadialBlur.qml
        -- Appending dependency found by qmlimportscanner: /opt/Qt/5.12.4/android_armv7/qml/QtGraphicalEffects/RadialGradient.qml
        -- Appending dependency found by qmlimportscanner: /opt/Qt/5.12.4/android_armv7/qml/QtGraphicalEffects/RectangularGlow.qml
        -- Appending dependency found by qmlimportscanner: /opt/Qt/5.12.4/android_armv7/qml/QtGraphicalEffects/RecursiveBlur.qml
        -- Appending dependency found by qmlimportscanner: /opt/Qt/5.12.4/android_armv7/qml/QtGraphicalEffects/ThresholdMask.qml
        -- Appending dependency found by qmlimportscanner: /opt/Qt/5.12.4/android_armv7/qml/QtGraphicalEffects/ZoomBlur.qml
      -- Adding '/opt/Qt/5.12.4/android_armv7/qml/QtGraphicalEffects/private' as QML dependency
      -- Adding '/opt/Qt/5.12.4/android_armv7/qml/QtQuick/Window.2' as QML dependency
      -- Adding '/opt/Qt/5.12.4/android_armv7/qml/QtQuick/Controls.2' as QML dependency
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.impl
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Universal.impl
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Fusion.impl
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Material.impl
      -- Adding '/opt/Qt/5.12.4/android_armv7/qml/QtQuick/Window.2' as QML dependency
      -- Adding '/opt/Qt/5.12.4/android_armv7/qml/QtGraphicalEffects' as QML dependency
      -- Adding '/opt/Qt/5.12.4/android_armv7/qml/QtQuick/Controls.2/Universal' as QML dependency
      -- Adding '/opt/Qt/5.12.4/android_armv7/qml/QtQuick/Controls.2/Fusion' as QML dependency
      -- Adding '/opt/Qt/5.12.4/android_armv7/qml/QtQuick/Controls.2/Material' as QML dependency
      -- Adding '/opt/Qt/5.12.4/android_armv7/qml/QtGraphicalEffects/private' as QML dependency
    Copying STL library
      -- Skipping file /home/lopeztel/android-ndk-r19c-linux-x86_64/android-ndk-r19c/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so. Same or newer file already in place.
    Copying 549 dependencies from Qt into package.
    Installing Android package to device.
    Running command "/home/lopeztel/Android/Sdk/platform-tools/adb -s ZY223NNPZZ  install -r /home/lopeztel/Qt/Projects/build-MQTT_Dashboard-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Release/android-build//build/outputs/apk/debug/android-build-debug.apk"
    Performing Streamed Install
    Success
    Android package built successfully in 4.177 ms.
      -- It can now be run from the selected device/emulator.
      -- File: /home/lopeztel/Qt/Projects/build-MQTT_Dashboard-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Release/android-build//build/outputs/apk/debug/android-build-debug.apk
    20:53:20: The process "/opt/Qt/5.12.4/android_armv7/bin/androiddeployqt" exited normally.
    20:53:20: Pulling files necessary for debugging.
    20:53:20: Package deploy: Running command "/home/lopeztel/Android/Sdk/platform-tools/adb -s ZY223NNPZZ pull /system/bin/app_process /home/lopeztel/Qt/Projects/build-MQTT_Dashboard-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Release/app_process".
    20:53:20: Package deploy: Running command "/home/lopeztel/Android/Sdk/platform-tools/adb -s ZY223NNPZZ pull /system/bin/app_process32 /home/lopeztel/Qt/Projects/build-MQTT_Dashboard-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Release/app_process".
    20:53:20: Package deploy: Running command "/home/lopeztel/Android/Sdk/platform-tools/adb -s ZY223NNPZZ pull /system/bin/linker /home/lopeztel/Qt/Projects/build-MQTT_Dashboard-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Release/linker".
    20:53:20: Package deploy: Running command "/home/lopeztel/Android/Sdk/platform-tools/adb -s ZY223NNPZZ pull /system/lib/libc.so /home/lopeztel/Qt/Projects/build-MQTT_Dashboard-Android_for_armeabi_v7a_Clang_Qt_5_12_4_for_Android_ARMv7_5e1c5e-Release/libc.so".
    20:53:21: Elapsed time: 00:12.
    

    I apologize for the really long post, I would appreciate any info that could push me in the right direction


 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.