Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Mobile compilation problem with JAVA version
Qt 6.11 is out! See what's new in the release blog

Mobile compilation problem with JAVA version

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 2.7k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    Stefanoxjx
    wrote on last edited by
    #1

    Hi guys,
    I've a problem with mobile compilation.
    In any project I've this errors:

    11:47:40: Initializing deployment to Android device/simulator
    11:47:40: Deploying to 
    11:47:40: Running steps for project provaAndroid...
    11:47:40: Starting: "/home/stefano/.Qt/Tools/CMake/bin/cmake" --build /home/stefano/build-provaAndroid-Android_Qt_6_4_1_Clang_x86_64-Debug --target all
    [1/1 420.2/sec] Copying provaAndroid binary to apk folder
    11:47:40: The process "/home/stefano/.Qt/Tools/CMake/bin/cmake" exited normally.
    11:47:40: Starting: "/home/stefano/.Qt/6.4.1/gcc_64/bin/androiddeployqt" --input /home/stefano/build-provaAndroid-Android_Qt_6_4_1_Clang_x86_64-Debug/android-provaAndroid-deployment-settings.json --output /home/stefano/build-provaAndroid-Android_Qt_6_4_1_Clang_x86_64-Debug/android-build --android-platform android-32 --jdk /usr/lib/jvm/java-8-openjdk-amd64 --gradle
    Generating Android Package
      Input file: /home/stefano/build-provaAndroid-Android_Qt_6_4_1_Clang_x86_64-Debug/android-provaAndroid-deployment-settings.json
      Output directory: /home/stefano/build-provaAndroid-Android_Qt_6_4_1_Clang_x86_64-Debug/android-build/
      Application binary: provaAndroid
      Android build platform: android-32
      Install to device: No
      -- Skipping /home/stefano/.Qt/6.4.1/android_x86_64/plugins/iconengines/libplugins_iconengines_qsvgicon_x86_64.so. It has unmet dependencies: lib/libQt6Svg_x86_64.so.
      -- Skipping /home/stefano/.Qt/6.4.1/android_x86_64/plugins/imageformats/libplugins_imageformats_qsvg_x86_64.so. It has unmet dependencies: lib/libQt6Svg_x86_64.so.
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Build file '/home/stefano/build-provaAndroid-Android_Qt_6_4_1_Clang_x86_64-Debug/android-build/build.gradle' line: 17
    
    * What went wrong:
    A problem occurred evaluating root project 'android-build'.
    > Failed to apply plugin 'com.android.internal.application'.
       > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
         Your current JDK is located in  /usr/lib/jvm/java-8-openjdk-amd64/jre
         You can try some of the following options:
           - changing the IDE settings.
           - changing the JAVA_HOME environment variable.
           - changing `org.gradle.java.home` in `gradle.properties`.
    
    * 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 629ms
    Building the android package failed!
      -- For more information, run this command with --verbose.
    11:47:41: The process "/home/stefano/.Qt/6.4.1/gcc_64/bin/androiddeployqt" exited with code 14.
    Error while building/deploying project provaAndroid (kit: Android Qt 6.4.1 Clang x86_64)
    When executing step "Build Android APK"
    11:47:41: Elapsed time: 00:01.
    

    This is the compilation of a clean QtQuick project.
    I already set JAVA_HOME to correct path:
    173fca99-ed92-48cf-a347-fccc1c676462-image.png
    but continue to have this error:

    > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
      Your current JDK is located in  /usr/lib/jvm/java-8-openjdk-amd64/jre
    

    I suspect that there is another place to change this path, but I don't where go to see.
    Can you help me?
    Thanks.

    Stefano

    1 Reply Last reply
    0
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by JoeCFD
      #2
      This post is deleted!
      S 1 Reply Last reply
      0
      • JoeCFDJ JoeCFD

        This post is deleted!

        S Offline
        S Offline
        Stefanoxjx
        wrote on last edited by
        #3

        @JoeCFD Hi and thanks for your help.
        As I already wrote, I've already installed Java 11 and changed JAVA_HOME path in Qt environment, but I cotinue to have this error and I don't know where I can change configuration for Gradle.

        d519d343-5f50-44db-a731-07c8638f3767-image.png

        jsulmJ 1 Reply Last reply
        0
        • JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by JoeCFD
          #4

          sorry I did not see it. It must be some path issue. Can you purge java 1.8 in /usr/lib/jvm/java-8-openjdk-amd64?
          also try to add:

          set(JAVA_HOME $ENV{JAVA_HOME})
          

          in your cmake file

          1 Reply Last reply
          1
          • S Stefanoxjx

            @JoeCFD Hi and thanks for your help.
            As I already wrote, I've already installed Java 11 and changed JAVA_HOME path in Qt environment, but I cotinue to have this error and I don't know where I can change configuration for Gradle.

            d519d343-5f50-44db-a731-07c8638f3767-image.png

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Stefanoxjx Did you try https://computingforgeeks.com/how-to-set-default-java-version-on-ubuntu-debian/ ?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            S 1 Reply Last reply
            1
            • jsulmJ jsulm

              @Stefanoxjx Did you try https://computingforgeeks.com/how-to-set-default-java-version-on-ubuntu-debian/ ?

              S Offline
              S Offline
              Stefanoxjx
              wrote on last edited by
              #6

              @jsulm Hi, yes, this is first thing that I did.
              Now I purged 1.8 version too, as reccomended by joeCFD, but at the moment I've another compilation problem and I have to fix this first.

              S 1 Reply Last reply
              0
              • S Stefanoxjx

                @jsulm Hi, yes, this is first thing that I did.
                Now I purged 1.8 version too, as reccomended by joeCFD, but at the moment I've another compilation problem and I have to fix this first.

                S Offline
                S Offline
                Stefanoxjx
                wrote on last edited by
                #7

                I solved the compilation problem and with purge of old java version all works fine :)
                Thanks a lot at all for 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