Fixed
Status Update
Comments
go...@jakewharton.com <go...@jakewharton.com> #2
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit b4d5b1c0ff880fe411cb0820e2503f91c4c23440
Author: Jake Wharton <jw@squareup.com>
Date: Tue Mar 05 23:14:25 2024
Invert dependency between lifecycle-runtime-compose and compose-ui-ui
This breaks an effective dependency cycle between library groups and will enable the future use of lifecycle-runtime-compose in a multiplatform context without a Compose UI dependency.
Before:
lifecycle-runtime-compose --> compose-ui-ui --> [lifecycle-runtime & compose-runtime]
After:
compose-ui-ui --> lifecycle-runtime-compose --> [lifeycle-runtime & compose-runtime]
The definition of the LocalLifecycleOwner composition local previosly lived in compose-ui-ui, which is why lifecycle-runtime-compose took a dependency on it. That composition local provided a LifecycleOwner into the Compose UI-based composition, and lifecycle-runtime-compose provided APIs on top of that LifecycleOwner.
The entirety of lifecycle-runtime-compose's APIs were built on lifecyle-runtime and compose-runtime with the sole exception being the use of the composition local to obtain the LifecycleOwner. By defining the composition local directly within lifecyle-runtime-compose, the dependency can be inverted making compose-ui-ui depend on it (it already depended on the regular runtime). This automatically exposes the Compose-based lifecycle APIs to downstream users of Compose UI and opens up usage of those APIs in compositions other than that provided by Compose UI (e.g., Molecule).
Bug: 328263448
Test: ./gradlew -p compose/ui bOS
Test: ./gradlew -p lifecycle bOS
Relnote: `LocalLifecycleOwner` moved from Compose UI to lifecycle-runtime-compose so that its Compose-based helper APIs can be used outside of Compose UI.
Change-Id: I6c41b92eb6aaab67e7d733dfe3fe0b429b46becf
M camera/integration-tests/avsynctestapp/build.gradle
M compose/ui/ui/build.gradle
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidCompositionLocals.android.kt
M lifecycle/lifecycle-runtime-compose/api/current.txt
M lifecycle/lifecycle-runtime-compose/api/restricted_current.txt
M lifecycle/lifecycle-runtime-compose/build.gradle
M lifecycle/lifecycle-runtime-compose/src/androidTest/java/androidx/lifecycle/compose/DropUnlessLifecycleTest.kt
M lifecycle/lifecycle-runtime-compose/src/androidTest/java/androidx/lifecycle/compose/LifecycleEffectTest.kt
M lifecycle/lifecycle-runtime-compose/src/main/java/androidx/lifecycle/compose/DropUnlessLifecycle.kt
M lifecycle/lifecycle-runtime-compose/src/main/java/androidx/lifecycle/compose/FlowExt.kt
M lifecycle/lifecycle-runtime-compose/src/main/java/androidx/lifecycle/compose/LifecycleEffect.kt
A lifecycle/lifecycle-runtime-compose/src/main/java/androidx/lifecycle/compose/LocalLifecycleOwner.kt
M wear/compose/integration-tests/navigation/build.gradle
https://android-review.googlesource.com/2989145
Branch: androidx-main
commit b4d5b1c0ff880fe411cb0820e2503f91c4c23440
Author: Jake Wharton <jw@squareup.com>
Date: Tue Mar 05 23:14:25 2024
Invert dependency between lifecycle-runtime-compose and compose-ui-ui
This breaks an effective dependency cycle between library groups and will enable the future use of lifecycle-runtime-compose in a multiplatform context without a Compose UI dependency.
Before:
lifecycle-runtime-compose --> compose-ui-ui --> [lifecycle-runtime & compose-runtime]
After:
compose-ui-ui --> lifecycle-runtime-compose --> [lifeycle-runtime & compose-runtime]
The definition of the LocalLifecycleOwner composition local previosly lived in compose-ui-ui, which is why lifecycle-runtime-compose took a dependency on it. That composition local provided a LifecycleOwner into the Compose UI-based composition, and lifecycle-runtime-compose provided APIs on top of that LifecycleOwner.
The entirety of lifecycle-runtime-compose's APIs were built on lifecyle-runtime and compose-runtime with the sole exception being the use of the composition local to obtain the LifecycleOwner. By defining the composition local directly within lifecyle-runtime-compose, the dependency can be inverted making compose-ui-ui depend on it (it already depended on the regular runtime). This automatically exposes the Compose-based lifecycle APIs to downstream users of Compose UI and opens up usage of those APIs in compositions other than that provided by Compose UI (e.g., Molecule).
Bug: 328263448
Test: ./gradlew -p compose/ui bOS
Test: ./gradlew -p lifecycle bOS
Relnote: `LocalLifecycleOwner` moved from Compose UI to lifecycle-runtime-compose so that its Compose-based helper APIs can be used outside of Compose UI.
Change-Id: I6c41b92eb6aaab67e7d733dfe3fe0b429b46becf
M camera/integration-tests/avsynctestapp/build.gradle
M compose/ui/ui/build.gradle
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidCompositionLocals.android.kt
M lifecycle/lifecycle-runtime-compose/api/current.txt
M lifecycle/lifecycle-runtime-compose/api/restricted_current.txt
M lifecycle/lifecycle-runtime-compose/build.gradle
M lifecycle/lifecycle-runtime-compose/src/androidTest/java/androidx/lifecycle/compose/DropUnlessLifecycleTest.kt
M lifecycle/lifecycle-runtime-compose/src/androidTest/java/androidx/lifecycle/compose/LifecycleEffectTest.kt
M lifecycle/lifecycle-runtime-compose/src/main/java/androidx/lifecycle/compose/DropUnlessLifecycle.kt
M lifecycle/lifecycle-runtime-compose/src/main/java/androidx/lifecycle/compose/FlowExt.kt
M lifecycle/lifecycle-runtime-compose/src/main/java/androidx/lifecycle/compose/LifecycleEffect.kt
A lifecycle/lifecycle-runtime-compose/src/main/java/androidx/lifecycle/compose/LocalLifecycleOwner.kt
M wear/compose/integration-tests/navigation/build.gradle
pb...@google.com <pb...@google.com> #4
The previous commit failed with
Buildbot Version: androidbuild_buildbot_20240304.00_RC00
Machine: abfarm-release-2004-0215
DIST_DIR=/buildbot/dist_dirs/aosp-androidx-main-linux-androidx/11562588 CHANGE_INFO=/buildbot/tmp/11562588-changeInfo frameworks/support/busytown/androidx.sh
############################################################################
Attempting to locate the relevant error messages via build_log_simplifier.py
############################################################################
Detected these failing tasks: []
> Configure project :internal-testutils-datastore
See the complete report at file://$SUPPORT/build/reports/configuration-cache/5whbbutylhu6d1sxb4ux0tn7b/29qe89nib49qplwpe4enj9tlr/configuration-cache-report.html
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':test:uiautomator:integration-tests:testapp:compileDebugAndroidTestKotlin'.
> Could not resolve all dependencies for configuration ':test:uiautomator:integration-tests:testapp:debugAndroidTestCompileClasspath'.
> Unable to align dependencies in configurations 'debugRuntimeClasspath' and 'debugAndroidTestRuntimeClasspath', as both require 'project :annotation:annotation', 'project :lifecycle:lifecycle-common'.
[Recommended action] Add the following dependencies to $SUPPORT/test/uiautomator/integration-tests/testapp/build.gradle:
androidTestImplementation(project(":annotation:annotation"))
androidTestImplementation(project(":lifecycle:lifecycle-common"))
> Get more help at https://help.gradle.org.
* Exception is:
org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the dependencies of task ':test:uiautomator:integration-tests:testapp:compileDebugAndroidTestKotlin'.
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all dependencies for configuration ':test:uiautomator:integration-tests:testapp:debugAndroidTestCompileClasspath'.
Caused by: com.android.builder.errors.EvalIssueException: Unable to align dependencies in configurations 'debugRuntimeClasspath' and 'debugAndroidTestRuntimeClasspath', as both require 'project :annotation:annotation', 'project :lifecycle:lifecycle-common'.
[Recommended action] Add the following dependencies to $SUPPORT/test/uiautomator/integration-tests/testapp/build.gradle:
androidTestImplementation(project(":annotation:annotation"))
androidTestImplementation(project(":lifecycle:lifecycle-common"))
at com.android.builder.errors.IssueReporter.reportError(IssueReporter.kt:131)
at com.android.build.gradle.internal.dependency.ConstraintHandler$checkConfigurationAlignments$1.execute(ConstraintHandler.kt:64)
at com.android.build.gradle.internal.dependency.ConstraintHandler$checkConfigurationAlignments$1.execute(ConstraintHandler.kt:33)
at jdk.proxy1/jdk.proxy1.$Proxy64.afterResolve(Unknown Source)
Caused by: java.lang.RuntimeException: Unable to align dependencies in configurations 'debugRuntimeClasspath' and 'debugAndroidTestRuntimeClasspath', as both require 'project :annotation:annotation', 'project :lifecycle:lifecycle-common'.
[Recommended action] Add the following dependencies to $SUPPORT/test/uiautomator/integration-tests/testapp/build.gradle:
androidTestImplementation(project(":annotation:annotation"))
androidTestImplementation(project(":lifecycle:lifecycle-common"))
at com.android.build.gradle.internal.dependency.ConstraintHandler$checkConfigurationAlignments$1.execute(ConstraintHandler.kt:66)
BUILD FAILED in 4m 41s
I am reverting it
il...@google.com <il...@google.com> #5
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit 7628b71530358ad7dcfab50fe636b54366dc12e8
Author: Jake Wharton <jw@squareup.com>
Date: Tue Mar 12 23:27:52 2024
Inline old LocalLifecycleOwner to new location
Bug: 328263448
Test: gw -p activity bOS
Test: gw -p camera bOS
Test: gw -p compose bOS
Test: gw -p lifecycle bOS
Test: gw -p navigation bOS
Test: gw -p wear bOS
Change-Id: I8d01349fef79b29a42062463ee40dc741f9c2b9c
M activity/activity-compose/src/androidTest/java/androidx/activity/compose/BackHandlerTest.kt
M activity/activity-compose/src/androidTest/java/androidx/activity/compose/PredictiveBackHandlerTest.kt
M camera/integration-tests/avsynctestapp/src/main/java/androidx/camera/integration/avsync/SignalGeneratorScreen.kt
M camera/integration-tests/uiwidgetstestapp/src/main/java/androidx/camera/integration/uiwidgets/compose/ui/screen/imagecapture/ImageCaptureScreen.kt
M camera/integration-tests/uiwidgetstestapp/src/main/java/androidx/camera/integration/uiwidgets/compose/ui/screen/videocapture/VideoCaptureScreen.kt
M camera/integration-tests/uiwidgetstestapp/src/main/java/androidx/camera/integration/uiwidgets/compose/ui/screen/viewfinder/ViewfinderScreen.kt
M compose/integration-tests/demos/src/main/java/androidx/compose/integration/demos/settings/PreferenceAsState.kt
M compose/integration-tests/demos/src/main/java/androidx/compose/integration/demos/settings/SoftInputModeSetting.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/TouchExplorationStateProvider.android.kt
M compose/runtime/runtime-livedata/src/androidTest/java/androidx/compose/runtime/livedata/LiveDataAdapterTest.kt
M compose/ui/ui-tooling/src/androidInstrumentedTest/kotlin/androidx/compose/ui/tooling/SimpleComposablePreview.kt
M compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/AndroidViewSample.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/owners/LifecycleOwnerInAppCompatActivityTest.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/owners/LifecycleOwnerInComponentActivityTest.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/owners/LifecycleOwnerInFragmentTest.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/platform/ComposeViewOverlayTest.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/viewinterop/AndroidViewTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/viewinterop/AndroidView.android.kt
M lifecycle/lifecycle-viewmodel-compose/src/androidTest/java/androidx/lifecycle/viewmodel/compose/ViewModelInAppCompatActivityTest.kt
M lifecycle/lifecycle-viewmodel-compose/src/androidTest/java/androidx/lifecycle/viewmodel/compose/ViewModelInComponentActivityTest.kt
M lifecycle/lifecycle-viewmodel-compose/src/androidTest/java/androidx/lifecycle/viewmodel/compose/ViewModelTest.kt
M navigation/navigation-compose/samples/src/main/java/androidx/navigation/compose/samples/NavigationSamples.kt
M navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavBackStackEntryProviderTest.kt
M navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostTest.kt
M navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavBackStackEntryProvider.kt
M navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavHost.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/TouchExplorationStateProvider.kt
M wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/PickerDemo.kt
https://android-review.googlesource.com/3002206
Branch: androidx-main
commit 7628b71530358ad7dcfab50fe636b54366dc12e8
Author: Jake Wharton <jw@squareup.com>
Date: Tue Mar 12 23:27:52 2024
Inline old LocalLifecycleOwner to new location
Bug: 328263448
Test: gw -p activity bOS
Test: gw -p camera bOS
Test: gw -p compose bOS
Test: gw -p lifecycle bOS
Test: gw -p navigation bOS
Test: gw -p wear bOS
Change-Id: I8d01349fef79b29a42062463ee40dc741f9c2b9c
M activity/activity-compose/src/androidTest/java/androidx/activity/compose/BackHandlerTest.kt
M activity/activity-compose/src/androidTest/java/androidx/activity/compose/PredictiveBackHandlerTest.kt
M camera/integration-tests/avsynctestapp/src/main/java/androidx/camera/integration/avsync/SignalGeneratorScreen.kt
M camera/integration-tests/uiwidgetstestapp/src/main/java/androidx/camera/integration/uiwidgets/compose/ui/screen/imagecapture/ImageCaptureScreen.kt
M camera/integration-tests/uiwidgetstestapp/src/main/java/androidx/camera/integration/uiwidgets/compose/ui/screen/videocapture/VideoCaptureScreen.kt
M camera/integration-tests/uiwidgetstestapp/src/main/java/androidx/camera/integration/uiwidgets/compose/ui/screen/viewfinder/ViewfinderScreen.kt
M compose/integration-tests/demos/src/main/java/androidx/compose/integration/demos/settings/PreferenceAsState.kt
M compose/integration-tests/demos/src/main/java/androidx/compose/integration/demos/settings/SoftInputModeSetting.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/TouchExplorationStateProvider.android.kt
M compose/runtime/runtime-livedata/src/androidTest/java/androidx/compose/runtime/livedata/LiveDataAdapterTest.kt
M compose/ui/ui-tooling/src/androidInstrumentedTest/kotlin/androidx/compose/ui/tooling/SimpleComposablePreview.kt
M compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/AndroidViewSample.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/owners/LifecycleOwnerInAppCompatActivityTest.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/owners/LifecycleOwnerInComponentActivityTest.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/owners/LifecycleOwnerInFragmentTest.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/platform/ComposeViewOverlayTest.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/viewinterop/AndroidViewTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/viewinterop/AndroidView.android.kt
M lifecycle/lifecycle-viewmodel-compose/src/androidTest/java/androidx/lifecycle/viewmodel/compose/ViewModelInAppCompatActivityTest.kt
M lifecycle/lifecycle-viewmodel-compose/src/androidTest/java/androidx/lifecycle/viewmodel/compose/ViewModelInComponentActivityTest.kt
M lifecycle/lifecycle-viewmodel-compose/src/androidTest/java/androidx/lifecycle/viewmodel/compose/ViewModelTest.kt
M navigation/navigation-compose/samples/src/main/java/androidx/navigation/compose/samples/NavigationSamples.kt
M navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavBackStackEntryProviderTest.kt
M navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostTest.kt
M navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavBackStackEntryProvider.kt
M navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavHost.kt
M wear/compose/compose-material/src/main/java/androidx/wear/compose/material/TouchExplorationStateProvider.kt
M wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/PickerDemo.kt
pr...@google.com <pr...@google.com> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.ui:ui:1.7.0-alpha05
androidx.compose.ui:ui-android:1.7.0-alpha05
androidx.compose.ui:ui-desktop:1.7.0-alpha05
androidx.lifecycle:lifecycle-runtime-compose:2.8.0-alpha03
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-main
commit b4348c7fe6b15e3c3f905b6f9a9e13263190af1c
Author: Jake Wharton <jw@squareup.com>
Date: Mon Mar 18 22:42:28 2024
Deprecate Compose UI's `LocalLifecycleOwner`
It was migrated to lifecycle-runtime-compose in I6c41b92eb6aaab67e7d733dfe3fe0b429b46becf and call-sites were migrated in I8d01349fef79b29a42062463ee40dc741f9c2b9c.
The final callers of the published API are now switched to point at the in-development project dependency so they can be migrated in this change.
Bug: 328263448
Test: gw -p compose bOS
Relnote: n/a
Change-Id: I68a3f7436d0a016ceed715b46ad60382324d2457
M activity/activity-compose/src/main/java/androidx/activity/compose/BackHandler.kt
M activity/activity-compose/src/main/java/androidx/activity/compose/PredictiveBackHandler.kt
M compose/runtime/runtime-livedata/build.gradle
M compose/runtime/runtime-livedata/src/main/java/androidx/compose/runtime/livedata/LiveDataAdapter.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidCompositionLocals.android.kt
M wear/compose/compose-navigation/build.gradle
M wear/compose/compose-navigation/src/main/java/androidx/wear/compose/navigation/SwipeDismissableNavHost.kt
https://android-review.googlesource.com/3007161
Branch: androidx-main
commit b4348c7fe6b15e3c3f905b6f9a9e13263190af1c
Author: Jake Wharton <jw@squareup.com>
Date: Mon Mar 18 22:42:28 2024
Deprecate Compose UI's `LocalLifecycleOwner`
It was migrated to lifecycle-runtime-compose in I6c41b92eb6aaab67e7d733dfe3fe0b429b46becf and call-sites were migrated in I8d01349fef79b29a42062463ee40dc741f9c2b9c.
The final callers of the published API are now switched to point at the in-development project dependency so they can be migrated in this change.
Bug: 328263448
Test: gw -p compose bOS
Relnote: n/a
Change-Id: I68a3f7436d0a016ceed715b46ad60382324d2457
M activity/activity-compose/src/main/java/androidx/activity/compose/BackHandler.kt
M activity/activity-compose/src/main/java/androidx/activity/compose/PredictiveBackHandler.kt
M compose/runtime/runtime-livedata/build.gradle
M compose/runtime/runtime-livedata/src/main/java/androidx/compose/runtime/livedata/LiveDataAdapter.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidCompositionLocals.android.kt
M wear/compose/compose-navigation/build.gradle
M wear/compose/compose-navigation/src/main/java/androidx/wear/compose/navigation/SwipeDismissableNavHost.kt
er...@gmail.com <er...@gmail.com> #9
This change produced a bug when using LocalLifecycleOwner
inside of the Compose Navigation route.
FATAL EXCEPTION: main (Ask Gemini)
Process: ir.erfansn.siliconecalculator, PID: 13496
java.lang.IllegalStateException: CompositionLocal LocalLifecycleOwner not present
at androidx.lifecycle.compose.LocalLifecycleOwnerKt$LocalLifecycleOwner$1.invoke(LocalLifecycleOwner.kt:26)
at androidx.lifecycle.compose.LocalLifecycleOwnerKt$LocalLifecycleOwner$1.invoke(LocalLifecycleOwner.kt:25)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at androidx.compose.runtime.LazyValueHolder.getCurrent(ValueHolders.kt:29)
pr...@google.com <pr...@google.com> #10
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.activity:activity-compose:1.10.0-alpha01
Description