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. Unable to build to android. (Newbie)
Forum Update on Monday, May 27th 2025

Unable to build to android. (Newbie)

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
androidandroid setting
7 Posts 3 Posters 4.3k 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.
  • E Offline
    E Offline
    elopez7
    wrote on last edited by
    #1

    Hello everyone. I am new to QT and I am trying to build to Android.
    I have installed Android studio and downloaded Android SDK, NDK and JDK and everything is hooked up to QT Creator, however when I try to build my project for Android I get this.
    Is there anything that I did wrong?
    I tried installing API levels from 20 to 28, and I tried compiling to each of them and I still get the same error.
    Thank you.

    FAILURE: Build failed with an exception.
    
    * Where:
    Build file 'D:\PROJECTS\QT\build-MobileTest2-Android_for_x86_Clang_Qt_5_12_1_for_Android_x86-Debug\android-build\build.gradle' line: 39
    
    * What went wrong:
    A problem occurred evaluating root project 'android-build'.
    > Invalid revision: android-7.1.1
    
    * 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
    
    BUILD FAILED in 7s
    Building the android package failed!
      -- For more information, run this command with --verbose.
    19:24:58: The process "C:\Qt\5.12.1\android_x86\bin\androiddeployqt.exe" exited with code 14.
    Error while building/deploying project MobileTest2 (kit: Android for x86 (Clang Qt 5.12.1 for Android x86))
    When executing step "Build Android APK"
    
    J.HilkJ T 2 Replies Last reply
    0
    • E elopez7

      Hello everyone. I am new to QT and I am trying to build to Android.
      I have installed Android studio and downloaded Android SDK, NDK and JDK and everything is hooked up to QT Creator, however when I try to build my project for Android I get this.
      Is there anything that I did wrong?
      I tried installing API levels from 20 to 28, and I tried compiling to each of them and I still get the same error.
      Thank you.

      FAILURE: Build failed with an exception.
      
      * Where:
      Build file 'D:\PROJECTS\QT\build-MobileTest2-Android_for_x86_Clang_Qt_5_12_1_for_Android_x86-Debug\android-build\build.gradle' line: 39
      
      * What went wrong:
      A problem occurred evaluating root project 'android-build'.
      > Invalid revision: android-7.1.1
      
      * 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
      
      BUILD FAILED in 7s
      Building the android package failed!
        -- For more information, run this command with --verbose.
      19:24:58: The process "C:\Qt\5.12.1\android_x86\bin\androiddeployqt.exe" exited with code 14.
      Error while building/deploying project MobileTest2 (kit: Android for x86 (Clang Qt 5.12.1 for Android x86))
      When executing step "Build Android APK"
      
      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      hi @elopez7 and welcome

      a couple of questions up front, because I can't find the info in your post.

      What version of JDK, NDK ans SDK are you using? Qt does not work with all combination and the working combination changed with the introduction of Qt 5.12

      Also, you're building for x86 architecture that is the less common one, do you know that? And did you install the precompiled x86 libs of Qt and not only the armv7/8 ones?

      Did you install both, and did you than select the correct one ?


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      E 1 Reply Last reply
      1
      • E elopez7

        Hello everyone. I am new to QT and I am trying to build to Android.
        I have installed Android studio and downloaded Android SDK, NDK and JDK and everything is hooked up to QT Creator, however when I try to build my project for Android I get this.
        Is there anything that I did wrong?
        I tried installing API levels from 20 to 28, and I tried compiling to each of them and I still get the same error.
        Thank you.

        FAILURE: Build failed with an exception.
        
        * Where:
        Build file 'D:\PROJECTS\QT\build-MobileTest2-Android_for_x86_Clang_Qt_5_12_1_for_Android_x86-Debug\android-build\build.gradle' line: 39
        
        * What went wrong:
        A problem occurred evaluating root project 'android-build'.
        > Invalid revision: android-7.1.1
        
        * 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
        
        BUILD FAILED in 7s
        Building the android package failed!
          -- For more information, run this command with --verbose.
        19:24:58: The process "C:\Qt\5.12.1\android_x86\bin\androiddeployqt.exe" exited with code 14.
        Error while building/deploying project MobileTest2 (kit: Android for x86 (Clang Qt 5.12.1 for Android x86))
        When executing step "Build Android APK"
        
        T Offline
        T Offline
        Tom_H
        wrote on last edited by
        #3

        @elopez7 Before building your application, test your installation by first building an app from Android Studio, and then build one of the example Android projects from Qt Creator. Do those work?

        J.HilkJ 1 Reply Last reply
        0
        • T Tom_H

          @elopez7 Before building your application, test your installation by first building an app from Android Studio, and then build one of the example Android projects from Qt Creator. Do those work?

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @Tom_H said in Unable to build to android. (Newbie):

          Android Studio

          A bit grain of salt from personal experience.
          I always had problems with Qt & Android when I had also installed Android Studio on my PC, so much that I once had to rest my PC.

          Since then I'm using the command line tools exclusively.


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          0
          • J.HilkJ J.Hilk

            hi @elopez7 and welcome

            a couple of questions up front, because I can't find the info in your post.

            What version of JDK, NDK ans SDK are you using? Qt does not work with all combination and the working combination changed with the introduction of Qt 5.12

            Also, you're building for x86 architecture that is the less common one, do you know that? And did you install the precompiled x86 libs of Qt and not only the armv7/8 ones?

            Did you install both, and did you than select the correct one ?

            E Offline
            E Offline
            elopez7
            wrote on last edited by
            #5

            Hi @J.Hilk and thank you.
            Admittedly at first I was using different version of each because I had downloaded them separately.
            I am now using everything that comes bundled with Android Studio, but I am still getting the same error. I will paste the full log in case that could be of any help. I am also uploading some screenshots showing my Android configuration in QT.
            @Tom_H I tried building an app from Android Studio and it worked perfectly, I tried building one of the examples and it throws a different error "type_traits" doesn't exist.

            I did not know about building for x86. Now, what would be the best combination that works for QT?

            I thank you guys for your help.

            Here is the full log

            initializing deployment to Android device/simulator
            Deploying to HAAXB761F57838K
            08:00:59: Running steps for project MobileTest2...
            08:00:59: Configuration unchanged, skipping qmake step.
            08:00:59: Starting: "C:\NVPACK\android-ndk-r12b\prebuilt\windows-x86_64\bin\make.exe" -j8
            make: Nothing to be done for `first'.
            08:01:01: The process "C:\NVPACK\android-ndk-r12b\prebuilt\windows-x86_64\bin\make.exe" exited normally.
            08:01:01: Removing directory D:\PROJECTS\QT\build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug\android-build/assets
            08:01:01: Removing directory D:\PROJECTS\QT\build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug\android-build/libs
            08:01:01: Starting: "C:\NVPACK\android-ndk-r12b\prebuilt\windows-x86_64\bin\make.exe" "INSTALL_ROOT=D:\PROJECTS\QT\build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug\android-build" install
            C:\Qt\5.12.1\android_arm64_v8a\bin\qmake.exe -install qinstall -exe libMobileTest2.so D:\PROJECTS\QT\build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug\android-build\libs\arm64-v8a\libMobileTest2.so
            08:01:02: The process "C:\NVPACK\android-ndk-r12b\prebuilt\windows-x86_64\bin\make.exe" exited normally.
            08:01:02: Starting: "C:\Qt\5.12.1\android_arm64_v8a\bin\androiddeployqt.exe" --input D:/PROJECTS/QT/build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug/android-libMobileTest2.so-deployment-settings.json --output D:/PROJECTS/QT/build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug/android-build --android-platform android-28 --jdk C:/NVPACK/jdk1.8.0_77 --gradle
            Generating Android Package
              Input file: D:/PROJECTS/QT/build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug/android-libMobileTest2.so-deployment-settings.json
              Output directory: D:/PROJECTS/QT/build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug/android-build/
              Application binary: D:/PROJECTS/QT/build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug/libMobileTest2.so
              Android build platform: android-28
              Install to device: No
            
            FAILURE: Build failed with an exception.
            
            * Where:
            Build file 'D:\PROJECTS\QT\build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug\android-build\build.gradle' line: 39
            
            * What went wrong:
            A problem occurred evaluating root project 'android-build'.
            > Invalid revision: android-7.1.1
            
            * 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
            
            BUILD FAILED in 7s
              -- Skipping C:/Qt/5.12.1/android_arm64_v8a/plugins/iconengines/libqsvgicon.so. It has unmet dependencies: lib/libQt5Svg.so.
              -- Skipping C:/Qt/5.12.1/android_arm64_v8a/plugins/imageformats/libqsvg.so. It has unmet dependencies: lib/libQt5Svg.so.
            Building the android package failed!
              -- For more information, run this command with --verbose.
            08:01:14: The process "C:\Qt\5.12.1\android_arm64_v8a\bin\androiddeployqt.exe" exited with code 14.
            Error while building/deploying project MobileTest2 (kit: Android for arm64-v8a (Clang Qt 5.12.1 for Android ARM64-v8a))
            When executing step "Build Android APK"
            08:01:14: Elapsed time: 00:15.
            

            Here are the screenshots of my configuration
            2_1551963792784_combo3.JPG 1_1551963792784_Combo2.JPG 0_1551963792783_Combo1.JPG

            J.HilkJ 1 Reply Last reply
            0
            • E elopez7

              Hi @J.Hilk and thank you.
              Admittedly at first I was using different version of each because I had downloaded them separately.
              I am now using everything that comes bundled with Android Studio, but I am still getting the same error. I will paste the full log in case that could be of any help. I am also uploading some screenshots showing my Android configuration in QT.
              @Tom_H I tried building an app from Android Studio and it worked perfectly, I tried building one of the examples and it throws a different error "type_traits" doesn't exist.

              I did not know about building for x86. Now, what would be the best combination that works for QT?

              I thank you guys for your help.

              Here is the full log

              initializing deployment to Android device/simulator
              Deploying to HAAXB761F57838K
              08:00:59: Running steps for project MobileTest2...
              08:00:59: Configuration unchanged, skipping qmake step.
              08:00:59: Starting: "C:\NVPACK\android-ndk-r12b\prebuilt\windows-x86_64\bin\make.exe" -j8
              make: Nothing to be done for `first'.
              08:01:01: The process "C:\NVPACK\android-ndk-r12b\prebuilt\windows-x86_64\bin\make.exe" exited normally.
              08:01:01: Removing directory D:\PROJECTS\QT\build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug\android-build/assets
              08:01:01: Removing directory D:\PROJECTS\QT\build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug\android-build/libs
              08:01:01: Starting: "C:\NVPACK\android-ndk-r12b\prebuilt\windows-x86_64\bin\make.exe" "INSTALL_ROOT=D:\PROJECTS\QT\build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug\android-build" install
              C:\Qt\5.12.1\android_arm64_v8a\bin\qmake.exe -install qinstall -exe libMobileTest2.so D:\PROJECTS\QT\build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug\android-build\libs\arm64-v8a\libMobileTest2.so
              08:01:02: The process "C:\NVPACK\android-ndk-r12b\prebuilt\windows-x86_64\bin\make.exe" exited normally.
              08:01:02: Starting: "C:\Qt\5.12.1\android_arm64_v8a\bin\androiddeployqt.exe" --input D:/PROJECTS/QT/build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug/android-libMobileTest2.so-deployment-settings.json --output D:/PROJECTS/QT/build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug/android-build --android-platform android-28 --jdk C:/NVPACK/jdk1.8.0_77 --gradle
              Generating Android Package
                Input file: D:/PROJECTS/QT/build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug/android-libMobileTest2.so-deployment-settings.json
                Output directory: D:/PROJECTS/QT/build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug/android-build/
                Application binary: D:/PROJECTS/QT/build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug/libMobileTest2.so
                Android build platform: android-28
                Install to device: No
              
              FAILURE: Build failed with an exception.
              
              * Where:
              Build file 'D:\PROJECTS\QT\build-MobileTest2-Android_for_arm64_v8a_Clang_Qt_5_12_1_for_Android_ARM64_v8a-Debug\android-build\build.gradle' line: 39
              
              * What went wrong:
              A problem occurred evaluating root project 'android-build'.
              > Invalid revision: android-7.1.1
              
              * 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
              
              BUILD FAILED in 7s
                -- Skipping C:/Qt/5.12.1/android_arm64_v8a/plugins/iconengines/libqsvgicon.so. It has unmet dependencies: lib/libQt5Svg.so.
                -- Skipping C:/Qt/5.12.1/android_arm64_v8a/plugins/imageformats/libqsvg.so. It has unmet dependencies: lib/libQt5Svg.so.
              Building the android package failed!
                -- For more information, run this command with --verbose.
              08:01:14: The process "C:\Qt\5.12.1\android_arm64_v8a\bin\androiddeployqt.exe" exited with code 14.
              Error while building/deploying project MobileTest2 (kit: Android for arm64-v8a (Clang Qt 5.12.1 for Android ARM64-v8a))
              When executing step "Build Android APK"
              08:01:14: Elapsed time: 00:15.
              

              Here are the screenshots of my configuration
              2_1551963792784_combo3.JPG 1_1551963792784_Combo2.JPG 0_1551963792783_Combo1.JPG

              J.HilkJ Offline
              J.HilkJ Offline
              J.Hilk
              Moderators
              wrote on last edited by
              #6

              @elopez7
              your ndk version is way to old. Qt 5.12 requires one that is able to use clang. The doc suggest to use the newest available.

              see the android started guide

              https://doc.qt.io/qt-5/android-getting-started.html


              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              E 1 Reply Last reply
              3
              • J.HilkJ J.Hilk

                @elopez7
                your ndk version is way to old. Qt 5.12 requires one that is able to use clang. The doc suggest to use the newest available.

                see the android started guide

                https://doc.qt.io/qt-5/android-getting-started.html

                E Offline
                E Offline
                elopez7
                wrote on last edited by
                #7

                @J.Hilk I could have sworn that the SDK manager installed the latest NDK.
                I updated manually and now it works. Thank you so much for your help!

                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