Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-111808

Build android application with QT6.4.2

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.4.2
    • Build System
    • None
    • Windows 10
      QT6.4.2
      Gradle7.4.2
      C++17
      JDK11

    Description

      I want to build an android application with QT, where when I build, an error occurs. The following is the compile output. It seems that there is something wrong with the JVM configuration, but I don't know how to fix it in QT.

       

      16:13:37: Initializing deployment to Android device/simulator
      16:13:37: Deploying to f3a72317
      16:13:37: Running steps for project android2...
      16:13:37: Starting: "E:\install\qt\6.4.2\android_armv7\bin\qmake.bat" E:\documents\QT\android2\android2.pro -spec android-clang
      Info: creating stash file E:\documents\QT\build-android2-Android_Qt_6_4_2_Clang_armeabi_v7a-Release\.qmake.stash
      16:13:38: The process "E:\install\qt\6.4.2\android_armv7\bin\qmake.bat" exited normally.
      16:13:38: Starting: "D:\install\AndroidSDK\android-sdk-windows\ndk\23.1.7779620\prebuilt\windows-x86_64\bin\make.exe" -f E:/documents/QT/build-android2-Android_Qt_6_4_2_Clang_armeabi_v7a-Release/Makefile qmake_all
      make: Nothing to be done for 'qmake_all'.
      16:13:38: The process "D:\install\AndroidSDK\android-sdk-windows\ndk\23.1.7779620\prebuilt\windows-x86_64\bin\make.exe" exited normally.
      16:13:38: Starting: "D:\install\AndroidSDK\android-sdk-windows\ndk\23.1.7779620\prebuilt\windows-x86_64\bin\make.exe" -j8
      E:\install\qt\6.4.2\mingw_64\bin\uic.exe ..\android2\mainwindow.ui -o ui_mainwindow.h
      D:\install\AndroidSDK\android-sdk-windows\ndk\23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -c -target armv7a-linux-androideabi23 -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -O2 -mthumb -Oz -std=gnu++1z -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\android2 -I. -I..\..\..\install\qt\6.4.2\android_armv7\include -I..\..\..\install\qt\6.4.2\android_armv7\include\QtWidgets -I..\..\..\install\qt\6.4.2\android_armv7\include\QtGui -I..\..\..\install\qt\6.4.2\android_armv7\include\QtCore -I. -I. -I..\..\..\install\qt\6.4.2\android_armv7\mkspecs\android-clang -o main.obj ..\android2\main.cpp
      D:\install\AndroidSDK\android-sdk-windows\ndk\23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -c -target armv7a-linux-androideabi23 -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -O2 -mthumb -Oz -std=gnu++1z -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\android2 -I. -I..\..\..\install\qt\6.4.2\android_armv7\include -I..\..\..\install\qt\6.4.2\android_armv7\include\QtWidgets -I..\..\..\install\qt\6.4.2\android_armv7\include\QtGui -I..\..\..\install\qt\6.4.2\android_armv7\include\QtCore -I. -I. -I..\..\..\install\qt\6.4.2\android_armv7\mkspecs\android-clang -o mainwindow.obj ..\android2\mainwindow.cpp
      D:\install\AndroidSDK\android-sdk-windows\ndk\23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -target armv7a-linux-androideabi23 -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -O2 -mthumb -Oz -std=gnu++1z -Wall -W -dM -E -o moc_predefs.h ..\..\..\install\qt\6.4.2\android_armv7\mkspecs\features\data\dummy.cpp
      E:\install\qt\6.4.2\mingw_64\bin\moc.exe -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --include E:/documents/QT/build-android2-Android_Qt_6_4_2_Clang_armeabi_v7a-Release/moc_predefs.h -IE:/install/qt/6.4.2/android_armv7/mkspecs/android-clang -IE:/documents/QT/android2 -IE:/install/qt/6.4.2/android_armv7/include -IE:/install/qt/6.4.2/android_armv7/include/QtWidgets -IE:/install/qt/6.4.2/android_armv7/include/QtGui -IE:/install/qt/6.4.2/android_armv7/include/QtCore -I. -ID:/install/AndroidSDK/android-sdk-windows/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/include/c++ -ID:/install/AndroidSDK/android-sdk-windows/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/lib64/clang/12.0.8/include -ID:/install/AndroidSDK/android-sdk-windows/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/include ..\android2\mainwindow.h -o moc_mainwindow.cpp
      D:\install\AndroidSDK\android-sdk-windows\ndk\23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -c -target armv7a-linux-androideabi23 -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -O2 -mthumb -Oz -std=gnu++1z -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\android2 -I. -I..\..\..\install\qt\6.4.2\android_armv7\include -I..\..\..\install\qt\6.4.2\android_armv7\include\QtWidgets -I..\..\..\install\qt\6.4.2\android_armv7\include\QtGui -I..\..\..\install\qt\6.4.2\android_armv7\include\QtCore -I. -I. -I..\..\..\install\qt\6.4.2\android_armv7\mkspecs\android-clang -o moc_mainwindow.obj moc_mainwindow.cpp
      ..\android2\main.cpp:8:36: warning: 'AA_EnableHighDpiScaling' is deprecated: High-DPI scaling is always enabled. This attribute no longer has any effect. [-Wdeprecated-declarations]
          QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
                                         ^
      ..\..\..\install\qt\6.4.2\android_armv7\include\QtCore/qnamespace.h:439:33: note: 'AA_EnableHighDpiScaling' has been explicitly marked deprecated here
              AA_EnableHighDpiScaling Q_DECL_ENUMERATOR_DEPRECATED_X(
                                      ^
      ..\..\..\install\qt\6.4.2\android_armv7\include\QtCore/qcompilerdetection.h:960:43: note: expanded from macro 'Q_DECL_ENUMERATOR_DEPRECATED_X'
      #define Q_DECL_ENUMERATOR_DEPRECATED_X(x) Q_DECL_DEPRECATED_X(x)
                                                ^
      ..\..\..\install\qt\6.4.2\android_armv7\include\QtCore/qcompilerdetection.h:956:36: note: expanded from macro 'Q_DECL_DEPRECATED_X'
      #  define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
                                         ^
      1 warning generated.
      D:\install\AndroidSDK\android-sdk-windows\ndk\23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -target armv7a-linux-androideabi23 -fno-limit-debug-info -Wl,--exclude-libs,libunwind.a -Wl,-soname,libandroid2_armeabi-v7a.so -Wl,--build-id=sha1 -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libandroid2_armeabi-v7a.so  main.obj mainwindow.obj moc_mainwindow.obj   E:/install/qt/6.4.2/android_armv7/lib/libQt6Widgets_armeabi-v7a.so E:/install/qt/6.4.2/android_armv7/lib/libQt6Gui_armeabi-v7a.so -lEGL E:/install/qt/6.4.2/android_armv7/lib/libQt6Core_armeabi-v7a.so -llog -pthread -lGLESv2   -llog -lz -lm -ldl -lc
      16:13:40: The process "D:\install\AndroidSDK\android-sdk-windows\ndk\23.1.7779620\prebuilt\windows-x86_64\bin\make.exe" exited normally.
      16:13:40: Starting: "D:\install\AndroidSDK\android-sdk-windows\ndk\23.1.7779620\prebuilt\windows-x86_64\bin\make.exe" "INSTALL_ROOT=E:\documents\QT\build-android2-Android_Qt_6_4_2_Clang_armeabi_v7a-Release\android-build" install && cd E:\documents\QT\build-android2-Android_Qt_6_4_2_Clang_armeabi_v7a-Release && D:\install\AndroidSDK\android-sdk-windows\ndk\23.1.7779620\prebuilt\windows-x86_64\bin\make.exe "INSTALL_ROOT=E:\documents\QT\build-android2-Android_Qt_6_4_2_Clang_armeabi_v7a-Release\android-build" install
      E:\install\qt\6.4.2\mingw_64\bin\qmake.exe -install qinstall -exe libandroid2_armeabi-v7a.so E:\documents\QT\build-android2-Android_Qt_6_4_2_Clang_armeabi_v7a-Release\android-build\libs\armeabi-v7a\libandroid2_armeabi-v7a.so
      E:\install\qt\6.4.2\mingw_64\bin\qmake.exe -install qinstall -exe libandroid2_armeabi-v7a.so E:\documents\QT\build-android2-Android_Qt_6_4_2_Clang_armeabi_v7a-Release\android-build\libs\armeabi-v7a\libandroid2_armeabi-v7a.so
      16:13:40: The process "D:\install\AndroidSDK\android-sdk-windows\ndk\23.1.7779620\prebuilt\windows-x86_64\bin\make.exe" exited normally.
      16:13:40: Starting: "E:\install\qt\6.4.2\mingw_64\bin\androiddeployqt.exe" --input E:/documents/QT/build-android2-Android_Qt_6_4_2_Clang_armeabi_v7a-Release/android-android2-deployment-settings.json --output E:/documents/QT/build-android2-Android_Qt_6_4_2_Clang_armeabi_v7a-Release/android-build --android-platform android-31 --jdk E:/install/JDK11 --gradle --release
      Generating Android Package
        Input file: E:/documents/QT/build-android2-Android_Qt_6_4_2_Clang_armeabi_v7a-Release/android-android2-deployment-settings.json
        Output directory: E:/documents/QT/build-android2-Android_Qt_6_4_2_Clang_armeabi_v7a-Release/android-build/
        Application binary: android2
        Android build platform: android-31
        Install to device: No
        -- Skipping E:/install/qt/6.4.2/android_armv7/plugins/iconengines/libplugins_iconengines_qsvgicon_armeabi-v7a.so. It has unmet dependencies: lib/libQt6Svg_armeabi-v7a.so.
        -- Skipping E:/install/qt/6.4.2/android_armv7/plugins/imageformats/libplugins_imageformats_qsvg_armeabi-v7a.so. It has unmet dependencies: lib/libQt6Svg_armeabi-v7a.so.
      Skipping createRCC
      Starting a Gradle Daemon (subsequent builds will be faster)
      
      FAILURE: Build failed with an exception.
      
      * What went wrong:
      Unable to start the daemon process.
      This problem might be caused by incorrect configuration of the daemon.
      For example, an unrecognized jvm option is used.
      Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/7.4.2/userguide/gradle_daemon.html
      Process command line: E:\install\JDK11\bin\java.exe -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2500m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Users\Force Keng\.gradle\wrapper\dists\gradle-7.4.2-bin\48ivgl02cpt2ed3fh9dbalvx8\gradle-7.4.2\lib\gradle-launcher-7.4.2.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 7.4.2
      Please read the following process output to find out more:
      -----------------------
      Error occurred during initialization of VM
      Could not reserve enough space for 2560000KB object heap
      
      
      * Try:
      > Run with --stacktrace option to get the stack trace.
      > Run with --info or --debug option to get more log output.
      > Run with --scan to get full insights.
      
      * Get more help at https://help.gradle.org
      Building the android package failed!
        -- For more information, run this command with --verbose.
      16:13:42: The process "E:\install\qt\6.4.2\mingw_64\bin\androiddeployqt.exe" exited with code 14.
      Error while building/deploying project android2 (kit: Android Qt 6.4.2 Clang armeabi-v7a)
      When executing step "Build Android APK"
      16:13:42: Elapsed time: 00:05.
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtandroidteam Qt Android Team
            forcekeng Power Keng
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes