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. A problem with Android versions in a QML program

A problem with Android versions in a QML program

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
9 Posts 2 Posters 1.1k 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.
  • T Offline
    T Offline
    tomy
    wrote on 23 Apr 2019, 20:39 last edited by tomy
    #1

    Hi all,

    Using Qt Creator 4.9.0 on Windows 10 x64 and Android stuff below, I created a QML program that works fine with the Desktop kit and also on a tablet running Anroid 4.4.2

    JDK: jdk1.8.0_211
    NDK: android-ndk-r19c
    SDK as below:

    0_1556051806303_Capture.PNG

    But the program doesn't work properly on a smartphone running Android ver 7! That is, at some time of the game, it stops! :(
    What's the problem please?
    Could it be because I've not installed sdk Android 7 API 24?

    I even changed the ndk from android-ndk-r19c to android-ndk-r18b, but no difference in outcome! :(

    K 1 Reply Last reply 24 Apr 2019, 06:22
    0
    • T tomy
      23 Apr 2019, 20:39

      Hi all,

      Using Qt Creator 4.9.0 on Windows 10 x64 and Android stuff below, I created a QML program that works fine with the Desktop kit and also on a tablet running Anroid 4.4.2

      JDK: jdk1.8.0_211
      NDK: android-ndk-r19c
      SDK as below:

      0_1556051806303_Capture.PNG

      But the program doesn't work properly on a smartphone running Android ver 7! That is, at some time of the game, it stops! :(
      What's the problem please?
      Could it be because I've not installed sdk Android 7 API 24?

      I even changed the ndk from android-ndk-r19c to android-ndk-r18b, but no difference in outcome! :(

      K Offline
      K Offline
      KroMignon
      wrote on 24 Apr 2019, 06:22 last edited by
      #2

      @tomy Hi Tomy, which Qt for Android version you are using?

      Take a look at Getting Started with Qt for Android to check your have set the right prerequisites according to your Qt Libs.

      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

      T 1 Reply Last reply 24 Apr 2019, 06:47
      1
      • K KroMignon
        24 Apr 2019, 06:22

        @tomy Hi Tomy, which Qt for Android version you are using?

        Take a look at Getting Started with Qt for Android to check your have set the right prerequisites according to your Qt Libs.

        T Offline
        T Offline
        tomy
        wrote on 24 Apr 2019, 06:47 last edited by
        #3

        @KroMignon Hi,

        I'm using the armv7 architecture. And Android build sdk = android-28.
        Could these answer your question please?
        And what do you mean by "Qt Libraries"?!

        K 1 Reply Last reply 24 Apr 2019, 06:50
        0
        • T tomy
          24 Apr 2019, 06:47

          @KroMignon Hi,

          I'm using the armv7 architecture. And Android build sdk = android-28.
          Could these answer your question please?
          And what do you mean by "Qt Libraries"?!

          K Offline
          K Offline
          KroMignon
          wrote on 24 Apr 2019, 06:50 last edited by
          #4

          @tomy said in A problem with Android versions in a QML program:

          And what do you mean by "Qt Libraries"?!

          Which Qt for Android version: Qt 5.7.0, Qt 5.7.1, etc.
          0_1556088595076_d0c7306f-e1d2-49b5-9283-10da4d76b2d6-image.png

          It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

          T 1 Reply Last reply 24 Apr 2019, 06:52
          0
          • K KroMignon
            24 Apr 2019, 06:50

            @tomy said in A problem with Android versions in a QML program:

            And what do you mean by "Qt Libraries"?!

            Which Qt for Android version: Qt 5.7.0, Qt 5.7.1, etc.
            0_1556088595076_d0c7306f-e1d2-49b5-9283-10da4d76b2d6-image.png

            T Offline
            T Offline
            tomy
            wrote on 24 Apr 2019, 06:52 last edited by
            #5

            @KroMignon

            0_1556088739422_Capture_3.PNG

            And I'm using Qt 5.12.3 (Qt Creator 4.9.0)

            K 1 Reply Last reply 24 Apr 2019, 07:09
            0
            • T tomy
              24 Apr 2019, 06:52

              @KroMignon

              0_1556088739422_Capture_3.PNG

              And I'm using Qt 5.12.3 (Qt Creator 4.9.0)

              K Offline
              K Offline
              KroMignon
              wrote on 24 Apr 2019, 07:09 last edited by
              #6

              @tomy Do you have more information about application crash? Just "it doesn't work" is not very useful to understand what's going wrong!

              Your software versions seems to match with Qt requirements, so it could be a software bug.

              It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

              T 1 Reply Last reply 24 Apr 2019, 07:32
              1
              • K KroMignon
                24 Apr 2019, 07:09

                @tomy Do you have more information about application crash? Just "it doesn't work" is not very useful to understand what's going wrong!

                Your software versions seems to match with Qt requirements, so it could be a software bug.

                T Offline
                T Offline
                tomy
                wrote on 24 Apr 2019, 07:32 last edited by tomy
                #7

                @KroMignon

                The program is here. It is a ping pong game and was working fine before. In this new version I add several design changes to it and now when tested on devices running Android 7, when the ball hits one of the rackets (especially the automatic one), that racket stops moving.

                K 1 Reply Last reply 24 Apr 2019, 08:22
                0
                • T tomy
                  24 Apr 2019, 07:32

                  @KroMignon

                  The program is here. It is a ping pong game and was working fine before. In this new version I add several design changes to it and now when tested on devices running Android 7, when the ball hits one of the rackets (especially the automatic one), that racket stops moving.

                  K Offline
                  K Offline
                  KroMignon
                  wrote on 24 Apr 2019, 08:22 last edited by
                  #8

                  @tomy said in A problem with Android versions in a QML program:

                  that racket stops moving.

                  This sound for me like a QML error which stops engine exception path. Do you have tried to run it for the Qt Creator IDE?
                  This will allow you to see QML engine log/error messages.
                  Or just look at Android logs with logcat?

                  It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                  T 1 Reply Last reply 24 Apr 2019, 20:11
                  0
                  • K KroMignon
                    24 Apr 2019, 08:22

                    @tomy said in A problem with Android versions in a QML program:

                    that racket stops moving.

                    This sound for me like a QML error which stops engine exception path. Do you have tried to run it for the Qt Creator IDE?
                    This will allow you to see QML engine log/error messages.
                    Or just look at Android logs with logcat?

                    T Offline
                    T Offline
                    tomy
                    wrote on 24 Apr 2019, 20:11 last edited by tomy
                    #9

                    @KroMignon

                    This sound for me like a QML error which stops engine exception path. Do you have tried to run it for the Qt Creator IDE?

                    Do you mean the Desktop kit (MinGW 64-bit)? I tested that using the Desktop kit on both Windows 10 x64 and Mac. On both, the program is working properly and without any issue.
                    Even I installed it on my iPhone, and it's working fine there as well.

                    As I said, on my tablet running Android 4.4.2 too, the program works as expected. But it has issues on devices running Android 7 or 9. (I have not tested the rest, 5, 6, 8, because I don't have those Android devices to hand)

                    So to narrow down the problem, I suppose it's related to the high level of Android versions from 6 or 7 upwards to 9.

                    This will allow you to see QML engine log/error messages.
                    Or just look at Android logs with logcat?

                    I Built the project in the Debug style using the Arm7 kit until it created the APK file, and here is the whole output of the Compile Output window:

                    00:34:32: Running steps for project PingPong...
                    00:34:32: Starting: "D:\Qt\Qt5.12.3\5.12.3\android_armv7\bin\qmake.exe" D:\Projects\QML\PingPong\PingPong\PingPong.pro -spec android-clang "CONFIG+=debug" "CONFIG+=qml_debug"
                    Info: creating stash file D:\Projects\QML\PingPong\build-PingPong-Android_for_armeabi_v7a_Clang_Qt_5_12_3_for_Android_ARMv7-Debug\.qmake.stash
                    00:34:34: The process "D:\Qt\Qt5.12.3\5.12.3\android_armv7\bin\qmake.exe" exited normally.
                    00:34:34: Starting: "D:\Qt_Stuff\android-ndk-r19c\prebuilt\windows-x86_64\bin\make.exe" -f D:/Projects/QML/PingPong/build-PingPong-Android_for_armeabi_v7a_Clang_Qt_5_12_3_for_Android_ARMv7-Debug/Makefile qmake_all
                    make: Nothing to be done for `qmake_all'.
                    00:34:34: The process "D:\Qt_Stuff\android-ndk-r19c\prebuilt\windows-x86_64\bin\make.exe" exited normally.
                    00:34:34: Starting: "D:\Qt_Stuff\android-ndk-r19c\prebuilt\windows-x86_64\bin\make.exe" -j4
                    D:\Qt_Stuff\android-ndk-r19c/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -c -D__ANDROID_API__=16 -target armv7-none-linux-androideabi -gcc-toolchain D:\Qt_Stuff\android-ndk-r19c/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64 -fno-limit-debug-info -DANDROID_HAS_WSTRING --sysroot=D:\Qt_Stuff\android-ndk-r19c/sysroot -isystem D:\Qt_Stuff\android-ndk-r19c/sysroot/usr/include/arm-linux-androideabi -isystem D:\Qt_Stuff\android-ndk-r19c/sources/cxx-stl/llvm-libc++/include -isystem D:\Qt_Stuff\android-ndk-r19c/sources/android/support/include -isystem D:\Qt_Stuff\android-ndk-r19c/sources/cxx-stl/llvm-libc++abi/include -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove -g -g -marm -O0 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I..\PingPong -I. -I..\..\..\..\Qt\Qt5.12.3\5.12.3\android_armv7\include -I..\..\..\..\Qt\Qt5.12.3\5.12.3\android_armv7\include\QtQuick -I..\..\..\..\Qt\Qt5.12.3\5.12.3\android_armv7\include\QtGui -I..\..\..\..\Qt\Qt5.12.3\5.12.3\android_armv7\include\QtQml -I..\..\..\..\Qt\Qt5.12.3\5.12.3\android_armv7\include\QtNetwork -I..\..\..\..\Qt\Qt5.12.3\5.12.3\android_armv7\include\QtCore -I. -I..\..\..\..\Qt\Qt5.12.3\5.12.3\android_armv7\mkspecs\android-clang -o main.obj ..\PingPong\main.cpp
                    D:\Qt\Qt5.12.3\5.12.3\android_armv7\bin\rcc.exe -name qml ..\PingPong\qml.qrc -o qrc_qml.cpp
                    D:\Qt_Stuff\android-ndk-r19c/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -c -D__ANDROID_API__=16 -target armv7-none-linux-androideabi -gcc-toolchain D:\Qt_Stuff\android-ndk-r19c/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64 -fno-limit-debug-info -DANDROID_HAS_WSTRING --sysroot=D:\Qt_Stuff\android-ndk-r19c/sysroot -isystem D:\Qt_Stuff\android-ndk-r19c/sysroot/usr/include/arm-linux-androideabi -isystem D:\Qt_Stuff\android-ndk-r19c/sources/cxx-stl/llvm-libc++/include -isystem D:\Qt_Stuff\android-ndk-r19c/sources/android/support/include -isystem D:\Qt_Stuff\android-ndk-r19c/sources/cxx-stl/llvm-libc++abi/include -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove -g -g -marm -O0 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I..\PingPong -I. -I..\..\..\..\Qt\Qt5.12.3\5.12.3\android_armv7\include -I..\..\..\..\Qt\Qt5.12.3\5.12.3\android_armv7\include\QtQuick -I..\..\..\..\Qt\Qt5.12.3\5.12.3\android_armv7\include\QtGui -I..\..\..\..\Qt\Qt5.12.3\5.12.3\android_armv7\include\QtQml -I..\..\..\..\Qt\Qt5.12.3\5.12.3\android_armv7\include\QtNetwork -I..\..\..\..\Qt\Qt5.12.3\5.12.3\android_armv7\include\QtCore -I. -I..\..\..\..\Qt\Qt5.12.3\5.12.3\android_armv7\mkspecs\android-clang -o qrc_qml.obj qrc_qml.cpp
                    D:\Qt_Stuff\android-ndk-r19c/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -D__ANDROID_API__=16 -target armv7-none-linux-androideabi -gcc-toolchain D:\Qt_Stuff\android-ndk-r19c/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -Wl,--exclude-libs,libunwind.a --sysroot=D:\Qt_Stuff\android-ndk-r19c/platforms/android-16/arch-arm/ -Wl,-soname,libPingPong.so -Wl,-rpath=D:/Qt/Qt5.12.3/5.12.3/android_armv7/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libPingPong.so main.obj qrc_qml.obj   -LD:/Qt/Qt5.12.3/5.12.3/android_armv7/lib -lQt5Quick -LD:\Qt\Qt5.12.3\5.12.3\android_armv7/lib -Lc:\Utils\Android\android-ndk-r18b/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGLESv2  -LD:\Qt_Stuff\android-ndk-r19c/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a D:\Qt_Stuff\android-ndk-r19c/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++.so.16 -llog -lz -lm -ldl -lc
                    00:34:49: The process "D:\Qt_Stuff\android-ndk-r19c\prebuilt\windows-x86_64\bin\make.exe" exited normally.
                    00:34:49: Starting: "D:\Qt_Stuff\android-ndk-r19c\prebuilt\windows-x86_64\bin\make.exe" "INSTALL_ROOT=D:\Projects\QML\PingPong\build-PingPong-Android_for_armeabi_v7a_Clang_Qt_5_12_3_for_Android_ARMv7-Debug\android-build" install
                    D:\Qt\Qt5.12.3\5.12.3\android_armv7\bin\qmake.exe -install qinstall -exe libPingPong.so D:\Projects\QML\PingPong\build-PingPong-Android_for_armeabi_v7a_Clang_Qt_5_12_3_for_Android_ARMv7-Debug\android-build\libs\armeabi-v7a\libPingPong.so
                    00:34:50: The process "D:\Qt_Stuff\android-ndk-r19c\prebuilt\windows-x86_64\bin\make.exe" exited normally.
                    00:34:50: Starting: "D:\Qt\Qt5.12.3\5.12.3\android_armv7\bin\androiddeployqt.exe" --input D:/Projects/QML/PingPong/build-PingPong-Android_for_armeabi_v7a_Clang_Qt_5_12_3_for_Android_ARMv7-Debug/android-libPingPong.so-deployment-settings.json --output D:/Projects/QML/PingPong/build-PingPong-Android_for_armeabi_v7a_Clang_Qt_5_12_3_for_Android_ARMv7-Debug/android-build --android-platform android-28 --jdk "C:/Program Files/Java/jdk1.8.0_211" --gradle
                    Generating Android Package
                      Input file: D:/Projects/QML/PingPong/build-PingPong-Android_for_armeabi_v7a_Clang_Qt_5_12_3_for_Android_ARMv7-Debug/android-libPingPong.so-deployment-settings.json
                      Output directory: D:/Projects/QML/PingPong/build-PingPong-Android_for_armeabi_v7a_Clang_Qt_5_12_3_for_Android_ARMv7-Debug/android-build/
                      Application binary: D:/Projects/QML/PingPong/build-PingPong-Android_for_armeabi_v7a_Clang_Qt_5_12_3_for_Android_ARMv7-Debug/libPingPong.so
                      Android build platform: android-28
                      Install to device: No
                      -- Skipping D:/Qt/Qt5.12.3/5.12.3/android_armv7/plugins/iconengines/libqsvgicon.so. It has unmet dependencies: lib/libQt5Svg.so.
                      -- Skipping D:/Qt/Qt5.12.3/5.12.3/android_armv7/plugins/imageformats/libqsvg.so. It has unmet dependencies: lib/libQt5Svg.so.
                    :checkDebugClasspath
                    :preBuild UP-TO-DATE
                    :preDebugBuild
                    :compileDebugAidl
                    :compileDebugRenderscript
                    :checkDebugManifest
                    :generateDebugBuildConfig
                    :prepareLintJar
                    :mainApkListPersistenceDebug
                    :generateDebugResValues
                    :generateDebugResources
                    :mergeDebugResources
                    :createDebugCompatibleScreenManifests
                    :processDebugManifest
                    :splitsDiscoveryTaskDebug
                    :processDebugResources
                    :generateDebugSources
                    :javaPreCompileDebug
                    Note: Some input files use or override a deprecated API.
                    Note: Recompile with -Xlint:deprecation for details.
                    :compileDebugJavaWithJavac
                    :compileDebugNdk NO-SOURCE
                    :compileDebugSources
                    :mergeDebugShaders
                    :compileDebugShaders
                    :generateDebugAssets
                    :mergeDebugAssets
                    :transformClassesWithDexBuilderForDebug
                    :transformDexArchiveWithExternalLibsDexMergerForDebug
                    :transformDexArchiveWithDexMergerForDebug
                    :mergeDebugJniLibFolders
                    :transformNativeLibsWithMergeJniLibsForDebug
                    :checkDebugLibraries
                    :processDebugJavaRes NO-SOURCE
                    :transformResourcesWithMergeJavaResForDebug
                    :validateSigningDebug
                    :packageDebug
                    :assembleDebug
                    
                    BUILD SUCCESSFUL in 1m 8s
                    28 actionable tasks: 28 executed
                    Android package built successfully in 85.063 ms.
                      -- File: D:/Projects/QML/PingPong/build-PingPong-Android_for_armeabi_v7a_Clang_Qt_5_12_3_for_Android_ARMv7-Debug/android-build//build/outputs/apk/debug/android-build-debug.apk
                    Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private.CppUtils
                    Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private.CppUtils
                    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.Fusion.impl
                    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.Material.impl
                    Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Universal.impl
                    00:36:15: The process "D:\Qt\Qt5.12.3\5.12.3\android_armv7\bin\androiddeployqt.exe" exited normally.
                    00:36:15: Elapsed time: 01:42.
                    

                    Other windows have no error/warning messages.

                    Isn't the problem belonging to my SDK? I have posted its list in my first post here. Shouldn't I add/remove any item from it?

                    1 Reply Last reply
                    0

                    5/9

                    24 Apr 2019, 06:52

                    • Login

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