Revert^2 "Move androidx.compose.ui.platform.LocalLifecycleOwner to common"

This reverts commit 17bd4a738c41eae914cd1819f87f9ae2bb69024f.
(cherry picked from https://android-review.googlesource.com/q/commit:07969d4122f813b42297e89baf6a015e58b5598c)
(cherry picked from https://android-review.googlesource.com/q/commit:abb648ab65413ad044411335d2055ca766ff8d60)
Merged-In: I4f20cd7e0ba5722e33fd0667697aecfa6537db05
Change-Id: I4f20cd7e0ba5722e33fd0667697aecfa6537db05
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/AndroidXImplPlugin.kt b/buildSrc/private/src/main/kotlin/androidx/build/AndroidXImplPlugin.kt
index e6f7c06..79e939c 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/AndroidXImplPlugin.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/AndroidXImplPlugin.kt
@@ -946,7 +946,8 @@
     ): JavaVersion {
         return when {
             projectName != null && projectName.contains("desktop") -> VERSION_11
-            targetName != null && targetName == "desktop" -> VERSION_11
+            targetName != null && (targetName == "desktop" || targetName == "jvmStubs") ->
+                VERSION_11
             libraryType == LibraryType.COMPILER_PLUGIN -> VERSION_11
             libraryType.compilationTarget == CompilationTarget.HOST -> VERSION_17
             else -> VERSION_1_8
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/AndroidXMultiplatformExtension.kt b/buildSrc/private/src/main/kotlin/androidx/build/AndroidXMultiplatformExtension.kt
index 967d798..b2efd14 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/AndroidXMultiplatformExtension.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/AndroidXMultiplatformExtension.kt
@@ -341,6 +341,22 @@
         }
     }
 
+    @JvmOverloads
+    fun jvmStubs(block: Action<KotlinJvmTarget>? = null): KotlinJvmTarget? {
+        supportedPlatforms.add(PlatformIdentifier.JVM_STUBS)
+        return if (project.enableJvm()) {
+            kotlinExtension.jvm("jvmStubs") {
+                block?.execute(this)
+                project.tasks.named("jvmStubsTest").configure {
+                    // don't try running common tests for stubs target
+                    it.enabled = false
+                }
+            }
+        } else {
+            null
+        }
+    }
+
     @OptIn(ExperimentalKotlinGradlePluginApi::class)
     @JvmOverloads
     fun android(block: Action<KotlinAndroidTarget>? = null): KotlinAndroidTarget? {
@@ -495,13 +511,24 @@
     @JvmOverloads
     fun linux(block: Action<KotlinNativeTarget>? = null): List<KotlinNativeTarget> {
         return listOfNotNull(
+            // linuxArm64(block), TODO
             linuxX64(block),
         )
     }
 
     @JvmOverloads
+    fun linuxArm64(block: Action<KotlinNativeTarget>? = null): KotlinNativeTarget? {
+        supportedPlatforms.add(PlatformIdentifier.LINUX_ARM_64)
+        return if (project.enableLinux()) {
+            kotlinExtension.linuxArm64().also { block?.execute(it) }
+        } else {
+            null
+        }
+    }
+
+    @JvmOverloads
     fun linuxX64(block: Action<KotlinNativeTarget>? = null): KotlinNativeTargetWithHostTests? {
-        supportedPlatforms.add(PlatformIdentifier.LINUX_64)
+        supportedPlatforms.add(PlatformIdentifier.LINUX_X_64)
         return if (project.enableLinux()) {
             kotlinExtension.linuxX64().also { block?.execute(it) }
         } else {
@@ -510,6 +537,22 @@
     }
 
     @JvmOverloads
+    fun linuxX64Stubs(block: Action<KotlinNativeTarget>? = null): KotlinNativeTarget? {
+        supportedPlatforms.add(PlatformIdentifier.LINUX_X_64_STUBS)
+        return if (project.enableLinux()) {
+            kotlinExtension.linuxX64("linuxx64Stubs") {
+                block?.execute(this)
+                project.tasks.named("linuxx64StubsTest").configure {
+                   // don't try running common tests for stubs target
+                   it.enabled = false
+                }
+            }
+        } else {
+            null
+        }
+    }
+
+    @JvmOverloads
     fun js(block: Action<KotlinJsTargetDsl>? = null): KotlinJsTargetDsl? {
         supportedPlatforms.add(PlatformIdentifier.JS)
         return if (project.enableJs()) {
@@ -645,11 +688,8 @@
      * List of Kotlin target names which may be used as source file suffixes. Any target whose name
      * does not appear in this list will use its [KotlinPlatformType] name.
      */
-    private val allowedTargetNameSuffixes = setOf(
-        "android",
-        "desktop",
-        "jvm"
-    )
+    private val allowedTargetNameSuffixes =
+        setOf("android", "desktop", "jvm", "jvmStubs", "linuxx64Stubs")
 
     /** The preferred source file suffix for the target's platform type. */
     private val KotlinTarget.preferredSourceFileSuffix: String
@@ -659,3 +699,9 @@
             platformType.name
         }
 }
+
+/**
+ * Set of targets are there to serve as stubs, but are not expected to be consumed by library
+ * consumers.
+ */
+internal val setOfStubTargets = setOf("jvmStubs", "linuxx64Stubs")
diff --git a/buildSrc/private/src/main/kotlin/androidx/build/SourceJarTaskHelper.kt b/buildSrc/private/src/main/kotlin/androidx/build/SourceJarTaskHelper.kt
index 2536412..479dce1 100644
--- a/buildSrc/private/src/main/kotlin/androidx/build/SourceJarTaskHelper.kt
+++ b/buildSrc/private/src/main/kotlin/androidx/build/SourceJarTaskHelper.kt
@@ -157,6 +157,8 @@
             // Different sourceSets in KMP should use different platform infixes, see b/203764756
             task.duplicatesStrategy = DuplicatesStrategy.FAIL
             kmpExtension.targets
+                // Filter out sources from stub targets as they are not intended to be documented
+                .filterNot { it.name in setOfStubTargets }
                 .flatMap { it.mainCompilation().allKotlinSourceSets }
                 .toSet()
                 .forEach { sourceSet ->
@@ -257,6 +259,8 @@
                 )
         )
     kmpExtension.targets.forEach { target ->
+        // Skip adding entries for stub targets are they are not intended to be documented
+        if (target.name in setOfStubTargets) return@forEach
         target.mainCompilation().allKotlinSourceSets.forEach {
             sourceSetsByName.getOrPut(it.name) {
                 mapOf(
diff --git a/buildSrc/public/src/main/kotlin/androidx/build/KmpPlatforms.kt b/buildSrc/public/src/main/kotlin/androidx/build/KmpPlatforms.kt
index ab190af..4fdb5b1 100644
--- a/buildSrc/public/src/main/kotlin/androidx/build/KmpPlatforms.kt
+++ b/buildSrc/public/src/main/kotlin/androidx/build/KmpPlatforms.kt
@@ -20,7 +20,6 @@
 import org.gradle.api.Project
 import org.gradle.kotlin.dsl.create
 import org.gradle.kotlin.dsl.findByType
-import org.jetbrains.kotlin.konan.target.HostManager
 
 /**
  * A comma-separated list of target platform groups you wish to enable or disable.
@@ -34,14 +33,16 @@
 enum class PlatformGroup {
     JVM,
     JS,
+    WASM,
     MAC,
+    WINDOWS,
     LINUX,
     DESKTOP,
     ANDROID_NATIVE;
 
     companion object {
         /** Target platform groups which require native compilation (e.g. LLVM). */
-        val native = listOf(MAC, LINUX, ANDROID_NATIVE)
+        val native = listOf(MAC, LINUX, WINDOWS, ANDROID_NATIVE)
 
         /**
          * Target platform groups which are enabled by default.
@@ -49,17 +50,16 @@
          * Do *not* enable [JS] unless you have read and understand this:
          * https://blog.jetbrains.com/kotlin/2021/10/important-ua-parser-js-exploit-and-kotlin-js/
          */
-        val enabledByDefault = listOf(JVM, DESKTOP, MAC, LINUX, ANDROID_NATIVE)
+        val enabledByDefault = listOf(JVM, DESKTOP, MAC, LINUX, WINDOWS, ANDROID_NATIVE, WASM)
     }
 }
 
 /** Target platforms supported by the AndroidX implementation of Kotlin multi-platform. */
-enum class PlatformIdentifier(
-    val id: String,
-    @Suppress("unused") private val group: PlatformGroup
-) {
+enum class PlatformIdentifier(val id: String, val group: PlatformGroup) {
     JVM("jvm", PlatformGroup.JVM),
+    JVM_STUBS("jvmStubs", PlatformGroup.JVM),
     JS("js", PlatformGroup.JS),
+    WASM_JS("wasmJs", PlatformGroup.WASM),
     ANDROID("android", PlatformGroup.JVM),
     ANDROID_NATIVE_ARM32("androidNativeArm32", PlatformGroup.ANDROID_NATIVE),
     ANDROID_NATIVE_ARM64("androidNativeArm64", PlatformGroup.ANDROID_NATIVE),
@@ -67,10 +67,21 @@
     ANDROID_NATIVE_X64("androidNativeX64", PlatformGroup.ANDROID_NATIVE),
     MAC_ARM_64("macosarm64", PlatformGroup.MAC),
     MAC_OSX_64("macosx64", PlatformGroup.MAC),
-    LINUX_64("linuxx64", PlatformGroup.LINUX),
+    MINGW_X_64("mingwx64", PlatformGroup.WINDOWS),
+    LINUX_ARM_64("linuxarm64", PlatformGroup.LINUX),
+    LINUX_X_64("linuxx64", PlatformGroup.LINUX),
+    LINUX_X_64_STUBS("linuxx64Stubs", PlatformGroup.LINUX),
     IOS_SIMULATOR_ARM_64("iossimulatorarm64", PlatformGroup.MAC),
     IOS_X_64("iosx64", PlatformGroup.MAC),
     IOS_ARM_64("iosarm64", PlatformGroup.MAC),
+    WATCHOS_SIMULATOR_ARM_64("watchossimulatorarm64", PlatformGroup.MAC),
+    WATCHOS_X_64("watchosx64", PlatformGroup.MAC),
+    WATCHOS_ARM_32("watchosarm64", PlatformGroup.MAC),
+    WATCHOS_ARM_64("watchosarm64", PlatformGroup.MAC),
+    WATCHOS_DEVICE_ARM_64("watchosdevicearm64", PlatformGroup.MAC),
+    TVOS_SIMULATOR_ARM_64("tvossimulatorarm64", PlatformGroup.MAC),
+    TVOS_X_64("tvosx64", PlatformGroup.MAC),
+    TVOS_ARM_64("tvosarm64", PlatformGroup.MAC),
     DESKTOP("desktop", PlatformGroup.JVM);
 
     companion object {
@@ -124,11 +135,14 @@
 fun Project.enableAndroidNative(): Boolean =
     enabledKmpPlatforms.contains(PlatformGroup.ANDROID_NATIVE)
 
-fun Project.enableMac(): Boolean =
-    enabledKmpPlatforms.contains(PlatformGroup.MAC) && HostManager.hostIsMac
+fun Project.enableMac(): Boolean = enabledKmpPlatforms.contains(PlatformGroup.MAC)
+
+fun Project.enableWindows(): Boolean = enabledKmpPlatforms.contains(PlatformGroup.WINDOWS)
 
 fun Project.enableLinux(): Boolean = enabledKmpPlatforms.contains(PlatformGroup.LINUX)
 
 fun Project.enableJvm(): Boolean = enabledKmpPlatforms.contains(PlatformGroup.JVM)
 
 fun Project.enableDesktop(): Boolean = enabledKmpPlatforms.contains(PlatformGroup.DESKTOP)
+
+fun Project.enableWasmJs(): Boolean = enabledKmpPlatforms.contains(PlatformGroup.WASM)
diff --git a/camera/integration-tests/avsynctestapp/build.gradle b/camera/integration-tests/avsynctestapp/build.gradle
index c46143f..0db836a 100644
--- a/camera/integration-tests/avsynctestapp/build.gradle
+++ b/camera/integration-tests/avsynctestapp/build.gradle
@@ -64,9 +64,10 @@
     }
 
     // Align dependencies in debugRuntimeClasspath and debugAndroidTestRuntimeClasspath.
-    androidTestImplementation("androidx.annotation:annotation-experimental:1.4.0")
+    androidTestImplementation("androidx.annotation:annotation-experimental:1.1.0")
     androidTestImplementation("androidx.annotation:annotation:1.8.0")
-    androidTestImplementation(project(":lifecycle:lifecycle-common"))
+    androidTestImplementation("androidx.lifecycle:lifecycle-common:2.6.1")
+    //androidTestImplementation(project(":lifecycle:lifecycle-common"))
 
     // Testing framework
     testImplementation(libs.kotlinCoroutinesTest)
diff --git a/collection/collection/build.gradle b/collection/collection/build.gradle
index 9c138bb..199df4e 100644
--- a/collection/collection/build.gradle
+++ b/collection/collection/build.gradle
@@ -50,7 +50,7 @@
         commonMain {
             dependencies {
                 api(libs.kotlinStdlib)
-                api("androidx.annotation:annotation:1.7.0")
+                api("androidx.annotation:annotation:1.8.1")
             }
         }
 
diff --git a/compose/ui/ui/build.gradle b/compose/ui/ui/build.gradle
index a866f51..be8f605 100644
--- a/compose/ui/ui/build.gradle
+++ b/compose/ui/ui/build.gradle
@@ -55,6 +55,9 @@
                 api(project(":compose:ui:ui-text"))
                 api(project(":compose:ui:ui-unit"))
                 api(project(":compose:ui:ui-util"))
+
+                api("androidx.lifecycle:lifecycle-runtime-compose:2.8.3")
+                // api(project(":lifecycle:lifecycle-runtime-compose"))
             }
         }
 
@@ -94,8 +97,8 @@
                 implementation('androidx.collection:collection:1.0.0')
                 implementation("androidx.customview:customview-poolingcontainer:1.0.0")
                 implementation("androidx.savedstate:savedstate-ktx:1.2.1")
-                api(project(":lifecycle:lifecycle-runtime-compose"))
-                implementation("androidx.lifecycle:lifecycle-viewmodel:2.6.1")
+                implementation("androidx.lifecycle:lifecycle-viewmodel:2.8.3")
+                implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.3")
                 implementation("androidx.emoji2:emoji2:1.2.0")
 
                 implementation("androidx.profileinstaller:profileinstaller:1.3.1")
diff --git a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidCompositionLocals.android.kt b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidCompositionLocals.android.kt
index 04e204c..17a47a4 100644
--- a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidCompositionLocals.android.kt
+++ b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidCompositionLocals.android.kt
@@ -34,7 +34,6 @@
 import androidx.compose.ui.ExperimentalComposeUiApi
 import androidx.compose.ui.res.ImageVectorCache
 import androidx.compose.ui.res.ResourceIdCache
-import androidx.lifecycle.LifecycleOwner
 import androidx.lifecycle.compose.LocalLifecycleOwner
 import androidx.savedstate.SavedStateRegistryOwner
 
@@ -61,14 +60,12 @@
     noLocalProvidedFor("LocalResourceIdCache")
 }
 
-/**
- * The CompositionLocal containing the current [LifecycleOwner].
- */
- @Deprecated(
+@Deprecated(
     "Moved to lifecycle-runtime-compose library in androidx.lifecycle.compose package.",
     ReplaceWith("androidx.lifecycle.compose.LocalLifecycleOwner"),
  )
-val LocalLifecycleOwner get() = LocalLifecycleOwner
+actual val LocalLifecycleOwner
+    get() = LocalLifecycleOwner
 
 /**
  * The CompositionLocal containing the current [SavedStateRegistryOwner].
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/CompositionLocals.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/CompositionLocals.kt
index e57bc42..15881ac 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/CompositionLocals.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/CompositionLocals.kt
@@ -22,6 +22,7 @@
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.CompositionLocal
 import androidx.compose.runtime.CompositionLocalProvider
+import androidx.compose.runtime.ProvidableCompositionLocal
 import androidx.compose.runtime.compositionLocalOf
 import androidx.compose.runtime.staticCompositionLocalOf
 import androidx.compose.ui.ExperimentalComposeUiApi
@@ -41,6 +42,7 @@
 import androidx.compose.ui.text.input.TextInputService
 import androidx.compose.ui.unit.Density
 import androidx.compose.ui.unit.LayoutDirection
+import androidx.lifecycle.LifecycleOwner
 
 /**
  * The CompositionLocal to provide communication with platform accessibility service.
@@ -192,9 +194,14 @@
     noLocalProvidedFor("LocalWindowInfo")
 }
 
-internal val LocalPointerIconService = staticCompositionLocalOf<PointerIconService?> {
-    null
-}
+/** The CompositionLocal containing the current [LifecycleOwner]. */
+@Deprecated(
+    "Moved to lifecycle-runtime-compose library in androidx.lifecycle.compose package.",
+    ReplaceWith("androidx.lifecycle.compose.LocalLifecycleOwner"),
+)
+expect val LocalLifecycleOwner: ProvidableCompositionLocal<LifecycleOwner>
+
+internal val LocalPointerIconService = staticCompositionLocalOf<PointerIconService?> { null }
 
 /** @see LocalScrollCaptureInProgress */
 internal val LocalProvidableScrollCaptureInProgress = compositionLocalOf { false }
diff --git a/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/NotImplemented.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/NotImplemented.desktop.kt
new file mode 100644
index 0000000..e435803
--- /dev/null
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/NotImplemented.desktop.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.compose.ui
+
+@Suppress("NOTHING_TO_INLINE")
+internal inline fun implementedInJetBrainsFork(): Nothing =
+    throw NotImplementedError(
+        """
+        Implemented only in JetBrains fork.
+        Please use `org.jetbrains.compose.ui:ui` package instead.
+        """
+            .trimIndent()
+    )
diff --git a/lifecycle/lifecycle-runtime-compose/src/desktopMain/kotlin/androidx/lifecycle/compose/LocalLifecycleOwner.desktop.kt b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/CompositionLocals.desktop.kt
similarity index 65%
copy from lifecycle/lifecycle-runtime-compose/src/desktopMain/kotlin/androidx/lifecycle/compose/LocalLifecycleOwner.desktop.kt
copy to compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/CompositionLocals.desktop.kt
index 1a1c7e5..3147a63 100644
--- a/lifecycle/lifecycle-runtime-compose/src/desktopMain/kotlin/androidx/lifecycle/compose/LocalLifecycleOwner.desktop.kt
+++ b/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/CompositionLocals.desktop.kt
@@ -14,15 +14,15 @@
  * limitations under the License.
  */
 
-@file:JvmName("LocalLifecycleOwnerKt")
-
-package androidx.lifecycle.compose
+package androidx.compose.ui.platform
 
 import androidx.compose.runtime.ProvidableCompositionLocal
-import androidx.compose.runtime.staticCompositionLocalOf
+import androidx.compose.ui.implementedInJetBrainsFork
 import androidx.lifecycle.LifecycleOwner
 
-public actual val LocalLifecycleOwner: ProvidableCompositionLocal<LifecycleOwner> =
-    staticCompositionLocalOf {
-        error("CompositionLocal LocalLifecycleOwner not present")
-    }
+@Deprecated(
+    "Moved to lifecycle-runtime-compose library in androidx.lifecycle.compose package.",
+    ReplaceWith("androidx.lifecycle.compose.LocalLifecycleOwner"),
+)
+actual val LocalLifecycleOwner: ProvidableCompositionLocal<LifecycleOwner>
+    get() = implementedInJetBrainsFork()
diff --git a/datastore/datastore-core/build.gradle b/datastore/datastore-core/build.gradle
index 3891e85..70c7a85 100644
--- a/datastore/datastore-core/build.gradle
+++ b/datastore/datastore-core/build.gradle
@@ -80,7 +80,7 @@
             dependencies {
                 api(libs.kotlinStdlib)
                 api(libs.kotlinCoroutinesCore)
-                api("androidx.annotation:annotation:1.7.0")
+                api("androidx.annotation:annotation:1.8.1")
             }
         }
 
diff --git a/datastore/datastore/build.gradle b/datastore/datastore/build.gradle
index 8189c7a..262750d 100644
--- a/datastore/datastore/build.gradle
+++ b/datastore/datastore/build.gradle
@@ -37,7 +37,7 @@
     jvm()
     mac()
     ios()
-    linux()
+    linux() // TODO: linuxX64()
     android()
 
     defaultPlatform(PlatformIdentifier.ANDROID)
@@ -47,7 +47,7 @@
             dependencies {
                 api(libs.kotlinStdlib)
                 api(libs.kotlinCoroutinesCore)
-                api("androidx.annotation:annotation:1.2.0")
+                api("androidx.annotation:annotation:1.8.1")
                 api(project(":datastore:datastore-core"))
                 api(project(":datastore:datastore-core-okio"))
             }
diff --git a/docs-public/build.gradle b/docs-public/build.gradle
index 8ef736c..518b691 100644
--- a/docs-public/build.gradle
+++ b/docs-public/build.gradle
@@ -95,7 +95,7 @@
     docs("androidx.compose.material:material-navigation:1.7.0-alpha07")
     samples("androidx.compose.material:material-navigation-samples:1.7.0-alpha07")
     kmpDocs("androidx.compose.material:material-ripple:1.7.0-alpha07")
-    kmpDocs("androidx.compose.runtime:runtime:1.7.0-alpha07")
+    kmpDocs("androidx.compose.runtime:runtime:1.7.1")
     docs("androidx.compose.runtime:runtime-livedata:1.7.0-alpha07")
     docs("androidx.compose.runtime:runtime-rxjava2:1.7.0-alpha07")
     docs("androidx.compose.runtime:runtime-rxjava3:1.7.0-alpha07")
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 4785dff..cce2e19 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -14,6 +14,12 @@
 androidGradlePluginMin = "7.0.4"
 androidLintMin = "30.0.4"
 androidLintMinCompose = "30.0.0"
+# androidxTestRunner = "1.6.1"
+# androidxTestRules = "1.6.1"
+# androidxTestMonitor = "1.7.1"
+# androidxTestCore = "1.6.1"
+# androidxTestExtJunit = "1.2.1"
+# androidxTestExtTruth = "1.6.0"
 androidxTestRunner = "1.6.0-alpha06"
 androidxTestRules = "1.6.0-alpha03"
 androidxTestMonitor = "1.7.0-alpha04"
diff --git a/hilt/hilt-navigation-compose/build.gradle b/hilt/hilt-navigation-compose/build.gradle
index 5383e0d..954f8b1 100644
--- a/hilt/hilt-navigation-compose/build.gradle
+++ b/hilt/hilt-navigation-compose/build.gradle
@@ -59,11 +59,17 @@
     kspAndroidTest(libs.hiltCompiler)
     androidTestImplementation(projectOrArtifact(":compose:material:material"))
     androidTestImplementation(project(":compose:test-utils"))
-    androidTestImplementation(projectOrArtifact(":lifecycle:lifecycle-common"))
-    androidTestImplementation(projectOrArtifact(":lifecycle:lifecycle-common-java8"))
-    androidTestImplementation(projectOrArtifact(":lifecycle:lifecycle-livedata-core"))
-    androidTestImplementation(projectOrArtifact(":lifecycle:lifecycle-viewmodel"))
-    androidTestImplementation(projectOrArtifact(":lifecycle:lifecycle-viewmodel-savedstate"))
+
+    androidTestImplementation("androidx.lifecycle:lifecycle-common:2.6.1")
+    //androidTestImplementation(projectOrArtifact(":lifecycle:lifecycle-common"))
+    androidTestImplementation("androidx.lifecycle:lifecycle-common-java8:2.6.1")
+    //androidTestImplementation(projectOrArtifact(":lifecycle:lifecycle-common-java8"))
+    androidTestImplementation("androidx.lifecycle:lifecycle-livedata-core:2.6.1")
+    //androidTestImplementation(projectOrArtifact(":lifecycle:lifecycle-livedata-core"))
+    androidTestImplementation("androidx.lifecycle:lifecycle-viewmodel:2.6.1")
+    //androidTestImplementation(projectOrArtifact(":lifecycle:lifecycle-viewmodel"))
+    androidTestImplementation("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1")
+    //androidTestImplementation(projectOrArtifact(":lifecycle:lifecycle-viewmodel-savedstate"))
 }
 
 hilt {
diff --git a/lifecycle/integration-tests/testapp/build.gradle b/lifecycle/integration-tests/testapp/build.gradle
index 1b3b2a2..63b6e14 100644
--- a/lifecycle/integration-tests/testapp/build.gradle
+++ b/lifecycle/integration-tests/testapp/build.gradle
@@ -31,6 +31,7 @@
     annotationProcessor(project(":lifecycle:lifecycle-compiler"))
 
     androidTestAnnotationProcessor(project(":lifecycle:lifecycle-compiler"))
+    // androidTestImplementation("androidx.lifecycle:lifecycle-common:2.6.1")
     androidTestImplementation(project(":lifecycle:lifecycle-common")) // Added for b/155802460
     androidTestImplementation(libs.testExtJunit)
     androidTestImplementation(libs.testCore)
diff --git a/lifecycle/lifecycle-common/build.gradle b/lifecycle/lifecycle-common/build.gradle
index 31848ca7..de6fb31 100644
--- a/lifecycle/lifecycle-common/build.gradle
+++ b/lifecycle/lifecycle-common/build.gradle
@@ -49,7 +49,7 @@
             dependencies {
                 api(libs.kotlinStdlib)
                 api(libs.kotlinCoroutinesCore)
-                api("androidx.annotation:annotation:1.8.0")
+                api("androidx.annotation:annotation:1.8.1")
             }
         }
 
diff --git a/lifecycle/lifecycle-runtime-compose/build.gradle b/lifecycle/lifecycle-runtime-compose/build.gradle
index e926f00..7c57917 100644
--- a/lifecycle/lifecycle-runtime-compose/build.gradle
+++ b/lifecycle/lifecycle-runtime-compose/build.gradle
@@ -23,6 +23,7 @@
  */
 import androidx.build.LibraryType
 import androidx.build.PlatformIdentifier
+import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
 
 plugins {
     id("AndroidXPlugin")
@@ -32,7 +33,8 @@
 
 androidXMultiplatform {
     android()
-    desktop()
+    jvmStubs()
+    linuxX64Stubs()
 
     defaultPlatform(PlatformIdentifier.ANDROID)
 
@@ -40,7 +42,7 @@
         commonMain {
             dependencies {
                 api(projectOrArtifact(":lifecycle:lifecycle-runtime"))
-                api("androidx.annotation:annotation:1.8.0")
+                api("androidx.annotation:annotation:1.8.1")
                 api("androidx.compose.runtime:runtime:1.7.1")
             }
         }
@@ -67,6 +69,18 @@
                 implementation(project(":kruth:kruth"))
             }
         }
+
+        nonAndroidMain {
+            dependsOn(commonMain)
+        }
+
+        jvmStubsMain {
+            dependsOn(nonAndroidMain)
+        }
+
+        linuxx64StubsMain {
+            dependsOn(nonAndroidMain)
+        }
     }
 }
 
diff --git a/lifecycle/lifecycle-runtime-compose/src/desktopMain/kotlin/androidx/lifecycle/compose/LocalLifecycleOwner.desktop.kt b/lifecycle/lifecycle-runtime-compose/src/nonAndroidMain/kotlin/androidx/lifecycle/compose/LocalLifecycleOwner.nonAndroid.kt
similarity index 96%
rename from lifecycle/lifecycle-runtime-compose/src/desktopMain/kotlin/androidx/lifecycle/compose/LocalLifecycleOwner.desktop.kt
rename to lifecycle/lifecycle-runtime-compose/src/nonAndroidMain/kotlin/androidx/lifecycle/compose/LocalLifecycleOwner.nonAndroid.kt
index 1a1c7e5..07eda1d 100644
--- a/lifecycle/lifecycle-runtime-compose/src/desktopMain/kotlin/androidx/lifecycle/compose/LocalLifecycleOwner.desktop.kt
+++ b/lifecycle/lifecycle-runtime-compose/src/nonAndroidMain/kotlin/androidx/lifecycle/compose/LocalLifecycleOwner.nonAndroid.kt
@@ -21,6 +21,7 @@
 import androidx.compose.runtime.ProvidableCompositionLocal
 import androidx.compose.runtime.staticCompositionLocalOf
 import androidx.lifecycle.LifecycleOwner
+import kotlin.jvm.JvmName
 
 public actual val LocalLifecycleOwner: ProvidableCompositionLocal<LifecycleOwner> =
     staticCompositionLocalOf {
diff --git a/test/uiautomator/integration-tests/testapp/build.gradle b/test/uiautomator/integration-tests/testapp/build.gradle
index 74b468e..0cd2a65 100644
--- a/test/uiautomator/integration-tests/testapp/build.gradle
+++ b/test/uiautomator/integration-tests/testapp/build.gradle
@@ -40,8 +40,11 @@
     androidTestImplementation(libs.testRunner)
 
     // Align dependencies in debugRuntimeClasspath and debugAndroidTestRuntimeClasspath.
-    androidTestImplementation(project(":lifecycle:lifecycle-common"))
+    androidTestImplementation("androidx.lifecycle:lifecycle-common:2.6.1")
+    //androidTestImplementation(project(":lifecycle:lifecycle-common"))
     androidTestImplementation("androidx.annotation:annotation:1.8.0")
+    androidTestImplementation(libs.junit)
+    androidTestImplementation(libs.testMonitor)
 }
 
 android {
diff --git a/testutils/testutils-datastore/build.gradle b/testutils/testutils-datastore/build.gradle
index 2721d70..2cf122b 100644
--- a/testutils/testutils-datastore/build.gradle
+++ b/testutils/testutils-datastore/build.gradle
@@ -32,7 +32,7 @@
 androidXMultiplatform {
     jvm {}
     mac()
-    linux()
+    linux() // TODO: linuxX64()
     ios()
 
     sourceSets {
diff --git a/wear/compose/integration-tests/navigation/build.gradle b/wear/compose/integration-tests/navigation/build.gradle
index a0c7ef3..ec8836d 100644
--- a/wear/compose/integration-tests/navigation/build.gradle
+++ b/wear/compose/integration-tests/navigation/build.gradle
@@ -54,6 +54,7 @@
     implementation(project(':wear:compose:compose-navigation'))
 
     // Align dependencies in debugRuntimeClasspath and debugAndroidTestRuntimeClasspath.
-    androidTestImplementation(project(":lifecycle:lifecycle-common"))
+    androidTestImplementation("androidx.lifecycle:lifecycle-common:2.6.1")
+    //androidTestImplementation(project(":lifecycle:lifecycle-common"))
     androidTestImplementation("androidx.annotation:annotation:1.8.0")
 }