[Probably obsolete] On Windows for Android: "No matching variant of com.android.tools.build:gradle:7.4.1 was found."
-
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 -
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
-
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 :-)
-