diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 0c6e3eeb9..cb18b33d6 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -119,6 +119,7 @@ dependencies { implementation(libs.androidx.navigation.compose) implementation(libs.androidx.window.manager) implementation(libs.androidx.profileinstaller) + implementation(libs.kotlinx.coroutines.guava) implementation(libs.coil.kt) } diff --git a/app/src/main/java/com/google/samples/apps/nowinandroid/MainActivity.kt b/app/src/main/java/com/google/samples/apps/nowinandroid/MainActivity.kt index ecc800904..e107fd88c 100644 --- a/app/src/main/java/com/google/samples/apps/nowinandroid/MainActivity.kt +++ b/app/src/main/java/com/google/samples/apps/nowinandroid/MainActivity.kt @@ -52,6 +52,7 @@ import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.onEach +import kotlinx.coroutines.guava.await import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import javax.inject.Inject @@ -168,7 +169,7 @@ class MainActivity : ComponentActivity() { "enqueued for compilation" when running the sample locally. */ withContext(Dispatchers.IO) { - val status = ProfileVerifier.getCompilationStatusAsync().get() + val status = ProfileVerifier.getCompilationStatusAsync().await() Log.d(TAG, "ProfileInstaller status code: ${status.profileInstallResultCode}") Log.d( TAG, diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d3262ab9c..3be086b09 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -117,6 +117,7 @@ hilt-ext-work = { group = "androidx.hilt", name = "hilt-work", version.ref = "hi junit4 = { group = "junit", name = "junit", version.ref = "junit4" } kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk8", version.ref = "kotlin" } kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "kotlinxCoroutines" } +kotlinx-coroutines-guava = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-guava", version.ref = "kotlinxCoroutines" } kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinxCoroutines" } kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "kotlinxDatetime" } kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" }