tv-samples icon indicating copy to clipboard operation
tv-samples copied to clipboard

JetStream: gradle sync fails with the latest Android Studio

Open gramound opened this issue 1 year ago • 4 comments

Gradle sync fails with the latest Android Studio. It is looking for java 17 explicitly in build.gradle.kts for both jetstream and benchmark. Is that obsolete? (Works fine without it)

kotlin {
    jvmToolchain(17)
}

gramound avatar Oct 02 '24 18:10 gramound

I should clarify "works fine without it" for my simple usage is like below. (Haven't tried the "baseline profile" thing, just open in Android Studio and run in the emulator)

--- a/JetStreamCompose/benchmark/build.gradle.kts
+++ b/JetStreamCompose/benchmark/build.gradle.kts
@@ -26,6 +26,2 @@ plugins {
 
-kotlin {
-    jvmToolchain(17)
-}
-
 android {
@@ -42,2 +38,10 @@ android {
 
+    compileOptions {
+        sourceCompatibility = JavaVersion.VERSION_1_8
+        targetCompatibility = JavaVersion.VERSION_1_8
+    }
+    kotlinOptions {
+        jvmTarget = "1.8"
+    }
+
     buildFeatures {
--- a/JetStreamCompose/gradle/libs.versions.toml
+++ b/JetStreamCompose/gradle/libs.versions.toml
@@ -2,4 +2,4 @@
 activity-compose = "1.9.2"
-android-gradle-plugin = "8.6.1"
-android-test-plugin = "8.6.1"
+android-gradle-plugin = "8.7.0"
+android-test-plugin = "8.7.0"
 androidx-baselineprofile = "1.3.1"
index 20db9ad..171d876 100644
--- a/JetStreamCompose/gradle/wrapper/gradle-wrapper.properties
+++ b/JetStreamCompose/gradle/wrapper/gradle-wrapper.properties
@@ -2,3 +2,3 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
 networkTimeout=10000
--- a/JetStreamCompose/jetstream/build.gradle.kts
+++ b/JetStreamCompose/jetstream/build.gradle.kts
@@ -25,6 +25,2 @@ plugins {
 
-kotlin {
-    jvmToolchain(17)
-}
-
 android {
@@ -47,2 +43,10 @@ android {
 
+    compileOptions {
+        sourceCompatibility = JavaVersion.VERSION_1_8
+        targetCompatibility = JavaVersion.VERSION_1_8
+    }
+    kotlinOptions {
+        jvmTarget = "1.8"
+    }
+
     buildTypes {

gramound avatar Oct 02 '24 21:10 gramound

I'm able to reproduce this on Android Studio Meerkat Feature Drop | 2024.3.2 Nightly 2025-02-07.

@pflammertsma Can you take a look at this?

tjohns avatar Feb 10 '25 10:02 tjohns

This #195 pull request should solve the problem.

croghostrider avatar Feb 11 '25 03:02 croghostrider

This #195 pull request should solve the problem.

Are you sure? It doesn't seem like the same error. I tried adding the compose-runtime base lib and it was still refusing to sync.

gramound avatar Mar 06 '25 16:03 gramound