Status Update
Comments
al...@gmail.com <al...@gmail.com> #2
Can you include a sample project that crashes in release mode?
ap...@google.com <ap...@google.com> #3
For us this is only happening in places where LifecycleEventEffect
is used. Example stacktrace:
Fatal Exception: java.lang.IllegalStateException
CompositionLocal LocalLifecycleOwner not present
androidx.lifecycle.compose.LocalLifecycleOwnerKt$LocalLifecycleOwner$1$1.invoke (LocalLifecycleOwner.android.kt:63)
androidx.lifecycle.compose.LocalLifecycleOwnerKt$LocalLifecycleOwner$1$1.invoke (LocalLifecycleOwner.android.kt:62)
kotlin.SynchronizedLazyImpl.getValue (LazyJVM.kt:74)
androidx.compose.runtime.LazyValueHolder.getCurrent (LazyValueHolder.java:29)
androidx.compose.runtime.LazyValueHolder.getValue (LazyValueHolder.java:31)
androidx.compose.runtime.CompositionLocalMapKt.read (CompositionLocalMap.kt:90)
androidx.compose.runtime.ComposerImpl.consume (Composer.kt:2135)
androidx.lifecycle.compose.LifecycleEffectKt.LifecycleEventEffect (LifecycleEffect.kt:748)
com.freeletics.feature.profile.ProfileUiKt$ProfileUi$1.invoke (ProfileUi.kt:62)
This is also on Lifecycle 2.8.2 with Compose 1.6.
al...@gmail.com <al...@gmail.com> #4
Here is a sample project
- Checkout repository
- Build release apk with ./gradlew :app:assembleRelease -PenableReleaseSigning=true
- App starts without crash
- Comment or remove line 14 in
https://github.com/nilsjr/Koncept/blob/develop/app/proguard-rules.pro - Build release apk with ./gradlew :app:assembleRelease -PenableReleaseSigning=true
- App crashing on start
FATAL EXCEPTION: main (Ask Gemini)
Process: de.nilsdruyen.koncept, PID: 5880
java.lang.IllegalStateException: CompositionLocal LocalLifecycleOwner not present
...
[Deleted User] <[Deleted User]> #5
Thank you for sharing the sample project. I can confirm that I was able to reproduce the issue, and that
se...@google.com <se...@google.com> #6
It appears that the custom ProGuard rule was not working as intended across all projects.
However, using public static *** getLocalLifecycleOwner();
(with the wildcard type ***
) seems to work consistently in the sample project and our internal experiments:
-if public class androidx.compose.ui.platform.AndroidCompositionLocals_androidKt {
public static *** getLocalLifecycleOwner();
}
-keep public class androidx.compose.ui.platform.AndroidCompositionLocals_androidKt {
public static *** getLocalLifecycleOwner();
}
We are investigating further, and we will be working on a fix for the issue.
al...@gmail.com <al...@gmail.com> #7
Branch: androidx-main
commit 79f5644cb937d950318c3c5ef2aca70ab1413119
Author: Marcello Galhardo <mgalhardo@google.com>
Date: Fri Jun 14 16:34:11 2024
Fix Lifecycle 2.8 custom ProGuard rule
* The custom ProGuard rule was not working as intended across all projects.
* Replacing by `public static *** getLocalLifecycleOwner();` (with the wildcard type `***`) seems to work consistently in all projects.
Fixes:
Test: manual
Change-Id: I4cfdecc0bbfc0be02d66efcee2c63bb5b025dca2
M lifecycle/lifecycle-runtime-compose/proguard-rules.pro
sa...@gmail.com <sa...@gmail.com> #8
Could you please make an immediate patch release as 2.8.2 crashes with the above exception?
al...@gmail.com <al...@gmail.com> #10
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.lifecycle:lifecycle-runtime-compose:2.8.3
androidx.lifecycle:lifecycle-runtime-compose-android:2.8.3
androidx.lifecycle:lifecycle-runtime-compose-desktop:2.8.3
[Deleted User] <[Deleted User]> #11
is...@gmail.com <is...@gmail.com> #12
There was a mix-up, and the Lifecycle 2.8.3 artifacts won't be available until Monday. Sorry for the false alarm.
ka...@gmail.com <ka...@gmail.com> #13
Seems to be good now. Thanks!
yu...@gmail.com <yu...@gmail.com> #14
Lifecycle 2.8.3 is now available on
li...@gmail.com <li...@gmail.com> #15
I'm still getting "java.lang.IllegalStateException: CompositionLocal LocalLifecycleOwner not present" with 2.8.3 in release builds (with obfuscation enabled). Adding
-keep class androidx.compose.ui.platform.AndroidCompositionLocals_androidKt { *; }
to my ProGuard rules fixes the issue. Any advice?
In my setup I have an app that's using the lifecycle dependencies directly, but some other dependencies of mine also include the same (and these libraries are obfuscated too) - not sure if this makes a difference.
ay...@gmail.com <ay...@gmail.com> #16
I'm unable to offer advice since I can't replicate the issue you're experiencing -- but based on your message, it appears Lifecycle "should" be working correctly.
Would you please
ay...@gmail.com <ay...@gmail.com> #17
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
s3...@gmail.com <s3...@gmail.com> #20
pi...@gmail.com <pi...@gmail.com> #21
Fovof d
pi...@gmail.com <pi...@gmail.com> #22
Ro dbod
ho...@gmail.com <ho...@gmail.com> #23
Actuvar
ga...@gmail.com <ga...@gmail.com> #24
Mantap
ka...@gmail.com <ka...@gmail.com> #25
Hloo
ka...@gmail.com <ka...@gmail.com> #26
osmanvhuyan
gu...@gmail.com <gu...@gmail.com> #27
Li
gu...@gmail.com <gu...@gmail.com> #28
mo...@gmail.com <mo...@gmail.com> #29
Ok
da...@gmail.com <da...@gmail.com> #30
thanks
Description
Version used: 2.0.0-beta01
Project:
Issue: com.firebase.ui.auth.data.remote.SignInKickstarter has its <init>(Application) removed.
Workaround: don't specify the allowshrinking option:
-keepclassmembers,allowobfuscation class * extends androidx.lifecycle.AndroidViewModel {
<init>(android.app.Application);
}