From 9c3d965a7ebbd4e05ec8c70d170e08e1f1e263ec Mon Sep 17 00:00:00 2001 From: Hugh Daschbach Date: Fri, 7 Apr 2023 20:53:28 -0700 Subject: [PATCH] Fix Java version for gradle:7.4.2. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When Gradle version was bumped to 7.0.0, it required Java version 11. In 82b9121 (2022/01/05), .sdkmanrc was adjusted to accommodate. But app/build.gradle.kts was not. More recent Gradle releases have started to complain: ,---- | > Could not resolve all files for configuration ':classpath'. | > Could not resolve com.android.tools.build:gradle:7.4.2. | Required by: | project : | > No matching variant of com.android.tools.build:gradle:7.4.2 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.2' but: | - Variant 'apiElements' capability com.android.tools.build:gradle:7.4.2 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 | - Other compatible attribute: | - Doesn't say anything about org.gradle.plugin.api-version (required '8.0.2') `---- Adjust gradle’s specification to suit. --- app/build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 0dd89ff..c0d7898 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -35,8 +35,8 @@ androidGitVersion { android { compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } namespace = "audio.funkwhale.ffa" @@ -46,7 +46,7 @@ android { } kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() + jvmTarget = JavaVersion.VERSION_11.toString() } buildFeatures {