Status Update
Comments
mg...@google.com <mg...@google.com> #2
Branch: androidx-main
commit c73bd92631a2ff341f89001bc9143c7b998333e8
Author: Sanura N'Jaka <sanura@google.com>
Date: Thu Aug 18 18:03:13 2022
Add project dependency constraint between lifecycle-viewmodel and lifecycle-viewmodel-savedstate
Added bi-directional project version constraint between
lifecycle-viewmodel and lifecycle-viewmodel-savedstate.
If both artifacts are in the dependency tree, their
versions should match. This will now be enforced by gradle
automatically bumping up either version to meet constraint.
Test: N/A
Bug: 242871265
Change-Id: I3ab2abf9b6b1861038afc0e651da80e4ee75efb8
M lifecycle/lifecycle-viewmodel-savedstate/build.gradle
gr...@gmail.com <gr...@gmail.com> #3
Branch: androidx-main
commit e7a81dc92c9c56b31455c75161a8becf49f761e3
Author: Sanura N'Jaka <sanura@google.com>
Date: Wed Aug 17 22:44:55 2022
Add project dependency constraint between lifecycle-runtime and lifecycle-runtime-compose
Added bi-directional project version constraint between
lifecycle-runtime and lifecycle-runtime-compose. If both
artifacts are in the dependency tree, their versions
should match. This will now be enforced by gradle
automatically bumping up either version to meet constraint.
Test: N/A
Bug: 242871265
Change-Id: I0f6b3928ac0b338b0fcc6835828dd43fadee8c0d
M lifecycle/lifecycle-runtime-compose/build.gradle
M lifecycle/lifecycle-runtime/build.gradle
ma...@marcardar.com <ma...@marcardar.com> #4
Branch: androidx-main
commit b671082b2d2ba47ca41f33646780e797ac6689cc
Author: Sanura N'Jaka <sanura@google.com>
Date: Wed Aug 17 20:02:11 2022
Add project dependency constraint between lifecycle-common and lifecycle-runtime
Added bi-directional project version constraint between lifecycle-common and
lifecycle-runtime. If both artifacts are in the dependency tree, their versions
should match. This will now be enforced by gradle automatically bumping up
either version to meet constraint.
Test: N/A
Bug: 242871265
Change-Id: I98fea6d1a6b2cde61b0cf5c7822cd98b6218c578
M lifecycle/lifecycle-runtime/build.gradle
M lifecycle/lifecycle-common/build.gradle
sj...@gmail.com <sj...@gmail.com> #5
Branch: androidx-main
commit f9794b48f28888fa27810c9b758062461d632454
Author: Sanura N'Jaka <sanura@google.com>
Date: Wed Aug 17 22:26:13 2022
Add project dependency constraint between lifecycle-runtime and lifecycle-runtime-testing
Added bi-directional project version constraint between
lifecycle-runtime and lifecycle-runtime-testing. If both
artifacts are in the dependency tree, their versions
should match. This will now be enforced by gradle
automatically bumping up either version to meet constraint.
Test: N/A
Bug: 242871265
Change-Id: I3ef6323dbdd3da20bad912e1bd7b9000e6832b7d
M lifecycle/lifecycle-runtime-testing/build.gradle
M lifecycle/lifecycle-runtime/build.gradle
ha...@gmail.com <ha...@gmail.com> #6
Branch: androidx-main
commit 34098809c70a985495ec836f286a7b8d8245808f
Author: Sanura N'Jaka <sanura@google.com>
Date: Wed Aug 17 22:16:45 2022
Add project dependency constraint between lifecycle-runtime and lifecycle-runtime-ktx
Added bi-directional project version constraint between
lifecycle-runtime and lifecycle-runtime-ktx. If both
artifacts are in the dependency tree, their versions
should match. This will now be enforced by gradle
automatically bumping up either version to meet constraint.
Test: N/A
Bug: 242871265
Change-Id: Id0a3eae91e652a3bdb7a64d1f17dd5c30e7fa03f
M lifecycle/lifecycle-runtime/build.gradle
M lifecycle/lifecycle-runtime-ktx/build.gradle
th...@gmail.com <th...@gmail.com> #7
Branch: androidx-main
commit e048cb40ff636b9d2abef88f5e67269b77c85b41
Author: Sanura N'Jaka <sanura@google.com>
Date: Thu Aug 18 17:50:35 2022
Add project dependency constraint between lifecycle-viewmodel and lifecycle-viewmodel-ktx
Added bi-directional project version constraint between
lifecycle-viewmodel and lifecycle-viewmodel-ktx. If both
artifacts are in the dependency tree, their versions
should match. This will now be enforced by gradle
automatically bumping up either version to meet constraint.
Test: N/A
Bug: 242871265
Change-Id: Iddf75acaeb3648cbb8b49d1a80fb7dc3258f9af1
M lifecycle/lifecycle-viewmodel/build.gradle
M lifecycle/lifecycle-viewmodel-ktx/build.gradle
mg...@google.com <mg...@google.com> #8
Branch: androidx-main
commit aad31661faf4f14036a23a5d0b73147dda032094
Author: Sanura N'Jaka <sanura@google.com>
Date: Thu Aug 18 17:45:05 2022
Add project dependency constraint between lifecycle-reactivestreams and lifecycle-reactivestreams-ktx
Added bi-directional project version constraint between
lifecycle-reactivestreams and lifecycle-reactivestreams-ktx.
If both artifacts are in the dependency tree, their versions
should match. This will now be enforced by gradle
automatically bumping up either version to meet constraint.
Test: N/A
Bug: 242871265
Change-Id: I8e39eed1d37def3dcc3aa38ef1f4edd1583f40c1
M lifecycle/lifecycle-reactivestreams/build.gradle
M lifecycle/lifecycle-reactivestreams-ktx/build.gradle
mg...@google.com <mg...@google.com>
th...@tempo.co.nz <th...@tempo.co.nz> #9
Branch: androidx-main
commit f83ce34e8fddb3eb499f98c1262c346d11ee0205
Author: Sanura N'Jaka <sanura@google.com>
Date: Thu Aug 18 17:28:49 2022
Add project dependency constraint between lifecycle-livedata and lifecycle-livedata-core
Added bi-directional project version constraint between
lifecycle-lifedata and lifecycle-livedata-core. If both
artifacts are in the dependency tree, their versions
should match. This will now be enforced by gradle
automatically bumping up either version to meet constraint.
Test: N/A
Bug: 242871265
Change-Id: I3e67cbe8fa8bbc3999f0f463f22b484ea66ba988
M lifecycle/lifecycle-livedata-core/build.gradle
M lifecycle/lifecycle-livedata/build.gradle
ju...@veepee.com <ju...@veepee.com> #10
Branch: androidx-main
commit fe17ed80e60d5ec3bb42fe0552415424b7b3dde5
Author: Sanura N'Jaka <sanura@google.com>
Date: Thu Aug 18 17:36:11 2022
Add project dependency constraint between lifecycle-livedata and lifecycle-livedata-ktx
Added bi-directional project version constraint between
lifecycle-lifedata and lifecycle-livedata-ktx. If both
artifacts are in the dependency tree, their versions
should match. This will now be enforced by gradle
automatically bumping up either version to meet constraint.
Test: N/A
Bug: 242871265
Change-Id: Iba6d1ffb952fd20be91b813dcac193ecc1776173
M lifecycle/lifecycle-livedata-ktx/build.gradle
M lifecycle/lifecycle-livedata/build.gradle
mg...@google.com <mg...@google.com> #11
Branch: androidx-main
commit 1e948aed8d0c01823ae60258ade0694da728b36d
Author: Sanura N'Jaka <sanura@google.com>
Date: Thu Aug 18 17:40:29 2022
Add project dependency constraint between lifecycle-livedata-core and lifecycle-livedata-core-ktx
Added bi-directional project version constraint between
lifecycle-lifedata-core and lifecycle-livedata-core-ktx.
If both artifacts are in the dependency tree, their
versions should match. This will now be enforced by gradle
automatically bumping up either version to meet constraint.
Test: N/A
Bug: 242871265
Change-Id: I6c6dd9de2e252217095c60de8ef577be6d940f1a
M lifecycle/lifecycle-livedata-core/build.gradle
M lifecycle/lifecycle-livedata-core-ktx/build.gradle
sj...@gmail.com <sj...@gmail.com> #12
Branch: androidx-main
commit 325aa99d830327ccf016231f9836cf04db65c3ff
Author: Sanura N'Jaka <sanura@google.com>
Date: Mon Aug 22 22:23:18 2022
Add project dependency constraint between lifecycle-common and lifecycle-livedata-core
Added bi-directional project version constraint between
lifecycle-common and lifecycle-livedata-core. If both
artifacts are in the dependency tree, their versions
should match. This will now be enforced by gradle
automatically bumping up either version to meet constraint.
Test: N/A
Bug: 242871265
Change-Id: I22e0fda00e22bc4fc56ac1bf5b7dcd2369ad533e
M lifecycle/lifecycle-livedata-core/build.gradle
M lifecycle/lifecycle-common/build.gradle
ap...@google.com <ap...@google.com> #13
Branch: androidx-main
commit 27355f7c30e816f6636928caeef29d473b896e28
Author: Sanura N'Jaka <sanura@google.com>
Date: Wed Aug 24 22:41:48 2022
Add project dependency constraint between lifecycle-viewmodel-savedstate and lifecycle-livedata-core
Added bi-directional project version constraint between
lifecycle-viewmodel-savedstate and lifecycle-livedata-core.
If both artifacts are in the dependency tree, their versions
should match. This will now be enforced by gradle automatically
bumping up either version to meet constraint.
Test: N/A
Fixes: 242871265
Change-Id: I94cc3ddd0f86033653c1477cf3f8ad8a1d93adae
M lifecycle/lifecycle-livedata-core/build.gradle
M lifecycle/lifecycle-viewmodel-savedstate/build.gradle
bo...@gmail.com <bo...@gmail.com> #14
Branch: androidx-main
commit 0598f5400a797fc9e31858e0d8a1b575ad7158a7
Author: Sanura N'Jaka <sanura@google.com>
Date: Thu Aug 18 18:28:20 2022
Add project dependency constraint between lifecycle-viewmodel-savedstate and lifecycle-viewmodel-compose
Added bi-directional project version constraint between
lifecycle-viewmodel-savedstate and lifecycle-viewmodel-compose.
If both artifacts are in the dependency tree, their versions
should match. This will now be enforced by gradle automatically
bumping up either version to meet constraint.
Test: N/A
Bug: 242871265
Change-Id: I2810d3afbe0cb8e8e387d1bc64eb3c698285d471
M lifecycle/lifecycle-viewmodel-savedstate/build.gradle
M lifecycle/lifecycle-viewmodel-compose/build.gradle
ra...@gmail.com <ra...@gmail.com> #15
ma...@gmail.com <ma...@gmail.com> #16
This release seems to have conflicting artifacts in the classpath. When both:
androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.0-alpha02
androidx-lifecycle:lifecycle-livedata-ktx:2.6.0-alpha02
are added as dependencies, the following error pops up:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':sync:sync-test:checkProdDebugAndroidTestDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class androidx.lifecycle.ViewModelLazy found in modules lifecycle-viewmodel-2.6.0-alpha02-runtime (androidx.lifecycle:lifecycle-viewmodel:2.6.0-alpha02) and lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1)
Duplicate class androidx.lifecycle.ViewTreeViewModelKt found in modules lifecycle-viewmodel-2.6.0-alpha02-runtime (androidx.lifecycle:lifecycle-viewmodel:2.6.0-alpha02) and lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1)
Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.
Downgrading to 2.6.0-alpha01
fixes this.
fi...@gmail.com <fi...@gmail.com> #17
As an update to the above comment from TJ, this issue has been fixed and will be available in Lifecycle 2.6.0-alpha03.
sj...@gmail.com <sj...@gmail.com> #18
The following release(s) address this bug:
androidx.lifecycle:lifecycle-runtime:2.6.0-alpha03
androidx.lifecycle:lifecycle-runtime-compose:2.6.0-alpha03
androidx.lifecycle:lifecycle-viewmodel-compose:2.6.0-alpha03
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.0-alpha03
mg...@google.com <mg...@google.com> #19
lifecycle-runtime-compose
2.8.* does not explicitly depend on compose-ui
1.7.* but there is a behavior compatibility issue between the versions - meaning standard POM dependency version checks will not detect the problem.
To understand the issue better, let’s go step by step on what happened:
- We have introduced a new
LocalLifecycleOwner
insidelifecycle-runtime-compose
. - We have inverted the dependency between
compose-ui
andlifecycle-runtime-compose
.- Before:
lifecycle-runtime-compose
- depends on ->compose-ui
. - After:
compose-ui
- depends on ->lifecycle-runtime-compose
.
- Before:
- We have changed the “old”
LocalLifecycleOwner
fromcompose-ui
to return the new one inlifecycle-runtime-compose
for binary compatibility.compose-ui
1.6.*, sets up the “old”LocalLifecycleOwner
at runtime.compose-ui
1.7.*, sets up the “new”LocalLifecycleOwner
at runtime.
lifecycle-runtime-compose
2.7.* needs the “old”LocalLifecycleOwner
.lifecycle-runtime-compose
2.8.* needs the “new”LocalLifecycleOwner
.
Now, when combining compose-ui
1.6.* and lifecycle-runtime-compose
2.8.* or compose-ui
1.7.* and lifecycle-runtime-compose
2.7.*, they will reference to different LocalLifecycleOwner
instances at runtime.
Since there's no direct dependency between them, standard POM checks cannot detect this issue. A call chain analysis would have been required to identify the behavior incompatibility between stable versions.
fi...@wartek.belajar.id <fi...@wartek.belajar.id> #20
mg...@google.com <mg...@google.com>
ap...@google.com <ap...@google.com> #21
Branch: androidx-main
commit 59dd212495f4378911cbb310367743b2aae734a3
Author: Marcello Galhardo <mgalhardo@google.com>
Date: Wed May 29 17:49:02 2024
Make `LocalLifecycleOwner` backward compatible with Compose 1.6.*
Lifecycle 2.8.* requires Compose 1.7.* for correctness, but
Compose 1.7.* have not yet reached stable.
For allowing Lifecycle 2.8.* to be used with Compose 1.6.*, we are
introducing the following measures:
* When Lifecycle 2.8.* detects it's running with Compose 1.6.*, it
uses reflection to access the previous version of
`androidx.compose.ui.platform.LocalLifecycleOwner`.
* A custom Proguard rule has been added to prevent the obfuscation of
`androidx.compose.ui.platform.LocalLifecycleOwner` when using
Compose 1.6.*. This ensures the reflection approach works correctly.
We have tested these backward compatibility measures in various
scenarios, including:
* Projects with and without Navigation Compose integrated.
* Compose versions 1.6.* and 1.7.*.
* Builds both with and without Proguard obfuscation applied.
Please note that backward compatibility reflection will be removed once
Compose 1.7.* is stable. A Gradle dependency constraint should be
put in place to ensure smooth migration for clients.
Fixes:
Test: manual
Change-Id: I3d0666a88eb309aae9a5c60eacc6818f52dd0bfd
M lifecycle/lifecycle-runtime-compose/build.gradle
A lifecycle/lifecycle-runtime-compose/proguard-rules.pro
A lifecycle/lifecycle-runtime-compose/src/androidMain/kotlin/androidx/lifecycle/compose/LocalLifecycleOwner.android.kt
M lifecycle/lifecycle-runtime-compose/src/commonMain/kotlin/androidx/lifecycle/compose/LocalLifecycleOwner.kt
A lifecycle/lifecycle-runtime-compose/src/desktopMain/kotlin/androidx/lifecycle/compose/LocalLifecycleOwner.desktop.kt
ca...@careem.com <ca...@careem.com> #22
Looking at the
mg...@google.com <mg...@google.com> #23
Lifecycle 2.8.1 was released last week (May 29, 2024). The workaround was merged yesterday (June 4, 2024), so it is not included in version 2.8.1. Please note that the "Date: Wed May 29" in the CL header above is a metadata that indicates when the CL was created, not when it was merged.
We intend to include it in the very next release, Lifecycle 2.8.2.
va...@cloudkitchens.com <va...@cloudkitchens.com> #24
pr...@google.com <pr...@google.com> #25
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.lifecycle:lifecycle-runtime-compose:2.8.2
androidx.lifecycle:lifecycle-runtime-compose-android:2.8.2
androidx.lifecycle:lifecycle-runtime-compose-desktop:2.8.2
li...@gmail.com <li...@gmail.com> #26
eg...@gmail.com <eg...@gmail.com> #27
Can confirm, the issue reproduces on release build
[Deleted User] <[Deleted User]> #28
ma...@gmail.com <ma...@gmail.com> #29
kr...@gmail.com <kr...@gmail.com> #30
Same for me too. I updated the Lifecycle lib to v2.8.2 and Compose BOM to v2024.06.00 which incorporate v1.6.8 of Compose libs. Still, the app got this exception and crashed, but only in the release mode and not in debug mode. Unfortunately, I got the crash in the production app after its release. After downgrading the Lifecycle lib to v2.7.0, it is working fine in the production app. Immediately, I had to release another patch version, so the users do not complain about app not working.
mg...@google.com <mg...@google.com> #31
We have received a similar report at -keep class androidx.compose.ui.platform.AndroidCompositionLocals_androidKt { *; }
to your ProGuard rules).
Although we have included a custom ProGuard rule as part of our fix, the rule is not working as intendend across all projects. We are currently investigating the problem, see
ba...@gmail.com <ba...@gmail.com> #32
Updating to 2.8.2 with Compose BOM "2024.06.00" the app is crashing on Release build with the error "CompositionLocal LocalLifecycleOwner not present".
A proguard rules should be provided or another version with fix.
su...@gmail.com <su...@gmail.com> #33
However, for the visitors
"-keep class androidx.compose.ui.platform.AndroidCompositionLocals_androidKt { *; }"
Add this to your app proguard file and it'll work fine.
ih...@enverus.com <ih...@enverus.com> #34
mo...@gmail.com <mo...@gmail.com> #35
I can confirm it's still an issue for me with Compose BOM "2024.06.00" and lifecycle 2.8.2.
I added these lines to proguard to fix the issue:
-if public class androidx.compose.ui.platform.AndroidCompositionLocals_androidKt {
public static *** getLocalLifecycleOwner();
}
-keep public class androidx.compose.ui.platform.AndroidCompositionLocals_androidKt {
public static *** getLocalLifecycleOwner();
}
mg...@google.com <mg...@google.com> #36
Following up on the issue mentioned in
mg...@google.com <mg...@google.com> #37
Following up on the issue mentioned in
mg...@google.com <mg...@google.com> #38
Lifecycle 2.8.3 is now available on
pr...@google.com <pr...@google.com> #39
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.lifecycle:lifecycle-runtime-compose:2.9.0-alpha01
androidx.lifecycle:lifecycle-runtime-compose-android:2.9.0-alpha01
androidx.lifecycle:lifecycle-runtime-compose-desktop:2.9.0-alpha01
Description
Version used:
lifecycle-runtime-compose:2.8.0-alpha03
androidx.compose.ui:ui-android:1.7.0-alpha03
When
Devices/Android versions reproduced on: Android14
When running collectAsStateWithLifecycle in setContent inside the fragment, the following error occurs.
Could any of the changes in lifecycle 2.8.0-alpha03 be caused by LocalLifecycleOwner's has different directory?
"LocalLifecycleOwner moved from Compose UI to lifecycle-runtime-compose so that its Compose-based helper APIs can be used outside of Compose UI"
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)
at androidx.compose.runtime.LazyValueHolder.getValue(ValueHolders.kt:31)
at androidx.compose.runtime.CompositionLocalMapKt.read(CompositionLocalMap.kt:90)
at androidx.compose.runtime.ComposerImpl.consume(Composer.kt:2135)
at androidx.lifecycle.compose.FlowExtKt.collectAsStateWithLifecycle(FlowExt.kt:180)