Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [Probably obsolete] On Windows for Android: "No matching variant of com.android.tools.build:gradle:7.4.1 was found."
QtWS25 Last Chance

[Probably obsolete] On Windows for Android: "No matching variant of com.android.tools.build:gradle:7.4.1 was found."

Scheduled Pinned Locked Moved Solved Installation and Deployment
3 Posts 2 Posters 2.4k 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.
  • S Offline
    S Offline
    SeDi
    wrote on 6 Jul 2023, 10:01 last edited by SeDi 7 Jul 2023, 00:03
    #1

    Hi, I am trying to compile and deploy for Android on my Win10 Pro machine with Qt 6.5.1 and Qt Creator 10.0.2, freshly upgraded. I have tried with Android Qt 6.5.1 Clang armeabi-v7a and arm64-v8a kits.

    The above Error Message occurs.
    First, it states "Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details"

    Then the build fails with this information:

    Could not resolve com.android.tools.build:gradle:7.4.1. [...]  
    No matching variant of com.android.tools.build:gradle:7.4.1 was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.0' but:
    
    - Variant 'apiElements' capability com.android.tools.build:gradle:7.4.1 declares a library, packaged as a jar, and its dependencies declared externally:
    - Incompatible because this component declares a component for use during compile-time, compatible with Java 11 and the consumer needed a component for use during runtime, compatible with Java 8
    

    On the first compile, I think I've noticed that apparently gradle V8.0 was being automagically downloaded and installed.

    The message "![The consumer was configured to find a library [...] with value '8.0'](image url)" seems to tell me, that somewhere (no idea where) I'll have to tell my project, that it needs to download and install 7.4.1. instead. Is that correct? Where and how can I do this?

    Screenshots of my settings below.
    TIA for any hints.

    BR
    Sebastian

    sdk manager.png build steps.png android settings.png

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Martin Burchell
      wrote on 18 Apr 2024, 11:40 last edited by
      #2

      I saw something similar with Qt 6.5.3, Qt Creator 13.0.0 on Ubuntu 20.04

      The reason was that although I had /usr/lib/jvm/java-17-openjdk-amd64 as my JDK location (Preferences -> Devices -> Android), I had the following line in the gradle.properties file under ANDROID_PACKAGE_SOURCE_DIR (specfified in .pro file):

      org.gradle.java.home=/usr/lib/jvm/default-java

      This was pointing to java-8-openjdk-amd64

      The fix was to point /usr/lib/jvm/default-java to java-17-openjdk-amd64 and set JDK location to /usr/lib/jvm/default-java

      1 Reply Last reply
      1
      • S Offline
        S Offline
        SeDi
        wrote on 18 Jul 2024, 22:15 last edited by
        #3

        Thanks! Your answer was most probably correct, but I've had additional issues that made it impossible to work with android, therefore all that mess. Upgrading Qt Creator and deleting AndroidSDK made it possible to do the Android stuff installation correctly. It finally works :-)

        1 Reply Last reply
        0
        • S SeDi has marked this topic as solved on 18 Jul 2024, 22:15

        • Login

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