Status Update
Comments
da...@google.com <da...@google.com> #2
Can you include a sample project that crashes in release mode?
b....@gmail.com <b....@gmail.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.
su...@google.com <su...@google.com>
b....@gmail.com <b....@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
...
su...@google.com <su...@google.com> #5
Thank you for sharing the sample project. I can confirm that I was able to reproduce the issue, and that
b....@gmail.com <b....@gmail.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.
su...@google.com <su...@google.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
b....@gmail.com <b....@gmail.com> #8
Could you please make an immediate patch release as 2.8.2 crashes with the above exception?
b....@gmail.com <b....@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
b....@gmail.com <b....@gmail.com> #11
b....@gmail.com <b....@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.
da...@google.com <da...@google.com> #13
Seems to be good now. Thanks!
b....@gmail.com <b....@gmail.com> #14
Lifecycle 2.8.3 is now available on
su...@google.com <su...@google.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.
b....@gmail.com <b....@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
b....@gmail.com <b....@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
b....@gmail.com <b....@gmail.com> #18
backtrace:
#00 pc 0000000000000000 <unknown>
#01 pc 0000000000025cdd /system/lib/libsqlite.so
#02 pc 0000000000025011 /system/lib/libsqlite.so
#03 pc 000000000000eb95 /system/lib/libsqlite.so
#04 pc 000000000002d60d /system/lib/libsqlite.so
#05 pc 000000000003b409 /system/lib/libsqlite.so
#06 pc 0000000000010931 /system/lib/libsqlite.so (sqlite3_step+536)
#07 pc 000000000007f175 /system/lib/libandroid_runtime.so
#08 pc 00000000018a0a33 /system/framework/arm/boot-framework.oat (android.database.sqlite.SQLiteConnection.nativeExecute+102)
#09 pc 00000000018a34b9 /system/framework/arm/boot-framework.oat (android.database.sqlite.SQLiteConnection.execute+260)
#10 pc 00000000018b3741 /system/framework/arm/boot-framework.oat (android.database.sqlite.SQLiteSession.endTransactionUnchecked+364)
#11 pc 00000000018b3ee5 /system/framework/arm/boot-framework.oat (android.database.sqlite.SQLiteSession.endTransaction+144)
#12 pc 00000000018ac61d /system/framework/arm/boot-framework.oat (android.database.sqlite.SQLiteDatabase.endTransaction+72)
#13 pc 00000000000a91c1 /system/lib/libart.so (art_quick_invoke_stub_internal+64)
#14 pc 00000000004031e9 /system/lib/libart.so (art_quick_invoke_stub+232)
#15 pc 00000000000b0455 /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+136)
#16 pc 00000000001ec389 /system/lib/libart.so (_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+200)
#17 pc 00000000001e6939 /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+492)
#18 pc 00000000003fd663 /system/lib/libart.so (MterpInvokeVirtualQuick+322)
#19 pc 000000000009fd94 /system/lib/libart.so (ExecuteMterpImpl+29972)
#20 pc 00000000001ca783 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+290)
#21 pc 00000000001cf2eb /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+114)
#22 pc 00000000001e691f /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+466)
#23 pc 00000000003fb92b /system/lib/libart.so (MterpInvokeInterface+826)
#24 pc 000000000009c214 /system/lib/libart.so (ExecuteMterpImpl+14740)
#25 pc 00000000001ca783 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+290)
#26 pc 00000000001cf2eb /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+114)
#27 pc 00000000001e691f /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+466)
#28 pc 00000000003fd663 /system/lib/libart.so (MterpInvokeVirtualQuick+322)
#29 pc 000000000009fd94 /system/lib/libart.so (ExecuteMterpImpl+29972)
#30 pc 00000000001ca783 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+290)
#31 pc 00000000001cf255 /system/lib/libart.so (_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameE+92)
#32 pc 00000000003f269f /system/lib/libart.so (artQuickToInterpreterBridge+706)
#33 pc 00000000000adc13 /system/lib/libart.so (art_quick_to_interpreter_bridge+34)
#34 pc 000000000064b125 /system/framework/arm/boot-core-libart.oat (java.util.concurrent.ThreadPoolExecutor.runWorker+344)
#35 pc 0000000000652b47 /system/framework/arm/boot-core-libart.oat (java.util.concurrent.ThreadPoolExecutor$Worker.run+42)
#36 pc 00000000005f749d /system/framework/arm/boot.oat (java.lang.Thread.run+48)
#37 pc 00000000000a91c1 /system/lib/libart.so (art_quick_invoke_stub_internal+64)
#38 pc 00000000004031e9 /system/lib/libart.so (art_quick_invoke_stub+232)
#39 pc 00000000000b0455 /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+136)
#40 pc 0000000000314031 /system/lib/libart.so (_ZN3artL18InvokeWithArgArrayERKNS_33ScopedObjectAccessAlreadyRunnableEPNS_9ArtMethodEPNS_8ArgArrayEPNS_6JValueEPKc+56)
#41 pc 0000000000314dfd /system/lib/libart.so (_ZN3art35InvokeVirtualOrInterfaceWithJValuesERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectP10_jmethodIDP6jvalue+256)
#42 pc 000000000032be19 /system/lib/libart.so (_ZN3art6Thread14CreateCallbackEPv+848)
#43 pc 0000000000046eb3 /system/lib/libc.so (_ZL15__pthread_startPv+22)
#44 pc 0000000000019acd /system/lib/libc.so (__start_thread+6)
su...@google.com <su...@google.com> #19
su...@google.com <su...@google.com> #20
b....@gmail.com <b....@gmail.com> #21
su...@google.com <su...@google.com> #22
b....@gmail.com <b....@gmail.com> #23
su...@google.com <su...@google.com> #24
b....@gmail.com <b....@gmail.com> #25
b....@gmail.com <b....@gmail.com> #26
WorkManager.initialize(applicationContext, workManagerConfig)
WorkManager.getInstance().getWorkInfosByTagLiveData(DownloadManager.WORK_MANAGER_DOWNLOAD_TAG).observeForever {}
If we wrap the second line in a coroutine to main just to delay it a cycle then the crash goes away, at least on our test device. We might roll out the fix to test it.
su...@google.com <su...@google.com> #27
b....@gmail.com <b....@gmail.com> #28
ra...@google.com <ra...@google.com> #29
I see this:
05-21 10:18:50.804 352 352 D SFPerfTracer: layers: (6:13) (FocusedStackFrame (0xb8370eb8): 0:108)* (DimLayer (0xb83412c0): 9:12) (StatusBar (0xb83bbf38): 0:701) (NavigationBar (0xb8389d10): 0:550) (com.android.systemui.ImageWallpaper (0xb83b23f8): 0:234) (DimLayer (0xb83989f0): 0:45)- (DimLayer (0xb83907e0): 0:8)- (com.example.workmanagercrash/com.example.workmanagercrash.MainActivity (0xb836c948): 0:31)- (com.android.systemui/com.android.systemui.recents.RecentsActivity (0xb838d188): 0:58)- (thumbnail anim (0xb834e7a0): 0:23)- (com.google.android.googlequicksearchbox/com.google.android.launcher.GEL (0xb834e7a0): 0:13) (Application Error: com.example.workmanagercrash (0xb83989f0): 8:14)
05-21 10:18:50.804 463 463 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-21 10:18:50.804 463 463 F DEBUG : Build fingerprint: 'motorola/victara_tmo/victara:6.0/MPES24.49-18-7/7:user/release-keys'
05-21 10:18:50.805 463 463 F DEBUG : Revision: 'p2bf'
05-21 10:18:50.805 463 463 F DEBUG : ABI: 'arm'
05-21 10:18:50.805 463 463 F DEBUG : pid: 9165, tid: 9180, name: WorkManager-Wor >>> com.example.workmanagercrash <<<
05-21 10:18:50.805 463 463 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
05-21 10:18:50.819 463 463 F DEBUG : r0 b9b04660 r1 af9ece50 r2 00000000 r3 00000002
05-21 10:18:50.819 463 463 F DEBUG : r4 b9b044b8 r5 b692e118 r6 00000000 r7 b9b04f08
05-21 10:18:50.819 463 463 F DEBUG : r8 00000001 r9 b9b044b8 sl 00000000 fp 00000002
05-21 10:18:50.819 463 463 F DEBUG : ip b692ddfc sp af9ece28 lr b6881e5b pc 00000000 cpsr 200f0010
05-21 10:18:50.823 463 463 F DEBUG :
05-21 10:18:50.823 463 463 F DEBUG : backtrace:
05-21 10:18:50.824 463 463 F DEBUG : #00 pc 00000000 <unknown>
05-21 10:18:50.824 463 463 F DEBUG : #01 pc 00024e59 /system/lib/libsqlite.so
05-21 10:18:50.824 463 463 F DEBUG : #02 pc 00024173 /system/lib/libsqlite.so
05-21 10:18:50.824 463 463 F DEBUG : #03 pc 0000e759 /system/lib/libsqlite.so
05-21 10:18:50.824 463 463 F DEBUG : #04 pc 0002be41 /system/lib/libsqlite.so
05-21 10:18:50.824 463 463 F DEBUG : #05 pc 00039ad7 /system/lib/libsqlite.so
05-21 10:18:50.824 463 463 F DEBUG : #06 pc 0000ffc5 /system/lib/libsqlite.so (sqlite3_step+724)
05-21 10:18:50.824 463 463 F DEBUG : #07 pc 00075021 /system/lib/libandroid_runtime.so
05-21 10:18:50.824 463 463 F DEBUG : #08 pc 02287663 /system/framework/arm/boot.oat (offset 0x1fda000)
05-21 10:18:51.062 1769 2069 V AlarmManager: sending alarm {f6ba791 type 3 *alarm*:android.content.jobscheduler.JOB_DELAY_EXPIRED}
05-21 10:18:51.065 1769 1769 V AlarmManager: done {f6ba791, *alarm*:android.content.jobscheduler.JOB_DELAY_EXPIRED} [3ms]
05-21 10:18:51.131 463 463 F DEBUG :
05-21 10:18:51.131 463 463 F DEBUG : Tombstone written to: /data/tombstones/tombstone_01
05-21 10:18:51.131 463 463 E DEBUG : AM write failed: Broken pipe
05-21 10:18:51.133 1769 1786 I BootReceiver: Copying /data/tombstones/tombstone_01 to DropBox (SYSTEM_TOMBSTONE)
05-21 10:18:51.184 485 485 I Zygote : Process 9165 exited due to signal (11)
05-21 10:18:51.214 1769 2729 I ActivityManager: Process com.example.workmanagercrash (pid 9165) has died
05-21 10:18:51.215 1769 2729 W ActivityManager: Scheduling restart of crashed service com.example.workmanagercrash/androidx.work.impl.background.systemjob.SystemJobService in 1000ms
05-21 10:18:51.238 1769 1769 I ActivityManager: Start proc 9188:com.example.workmanagercrash/u0a106 for service com.example.workmanagercrash/androidx.work.impl.background.systemjob.SystemJobService
05-21 10:18:51.256 9188 9188 I art : Late-enabling -Xcheck:jni
05-21 10:18:51.301 9188 9188 W System : ClassLoader referenced unknown path: /data/app/com.example.workmanagercrash-1/lib/arm
05-21 10:18:51.476 9188 9202 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 9202 (WorkManager-Wor)
05-21 10:18:51.578 463 463 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-21 10:18:51.578 463 463 F DEBUG : Build fingerprint: 'motorola/victara_tmo/victara:6.0/MPES24.49-18-7/7:user/release-keys'
05-21 10:18:51.579 463 463 F DEBUG : Revision: 'p2bf'
05-21 10:18:51.579 463 463 F DEBUG : ABI: 'arm'
05-21 10:18:51.579 463 463 F DEBUG : pid: 9188, tid: 9202, name: WorkManager-Wor >>> com.example.workmanagercrash <<<
05-21 10:18:51.580 463 463 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
05-21 10:18:51.609 463 463 F DEBUG : r0 b9b048c0 r1 af9ece50 r2 00000000 r3 00000002
05-21 10:18:51.609 463 463 F DEBUG : r4 b9b04718 r5 b692e118 r6 00000000 r7 b9b05170
05-21 10:18:51.609 463 463 F DEBUG : r8 00000001 r9 b9b04718 sl 00000000 fp 00000002
05-21 10:18:51.609 463 463 F DEBUG : ip b692ddfc sp af9ece28 lr b6881e5b pc 00000000 cpsr 200f0010
05-21 10:18:51.615 463 463 F DEBUG :
05-21 10:18:51.615 463 463 F DEBUG : backtrace:
05-21 10:18:51.616 463 463 F DEBUG : #00 pc 00000000 <unknown>
05-21 10:18:51.616 463 463 F DEBUG : #01 pc 00024e59 /system/lib/libsqlite.so
05-21 10:18:51.616 463 463 F DEBUG : #02 pc 00024173 /system/lib/libsqlite.so
05-21 10:18:51.616 463 463 F DEBUG : #03 pc 0000e759 /system/lib/libsqlite.so
05-21 10:18:51.616 463 463 F DEBUG : #04 pc 0002be41 /system/lib/libsqlite.so
05-21 10:18:51.616 463 463 F DEBUG : #05 pc 00039ad7 /system/lib/libsqlite.so
05-21 10:18:51.616 463 463 F DEBUG : #06 pc 0000ffc5 /system/lib/libsqlite.so (sqlite3_step+724)
05-21 10:18:51.616 463 463 F DEBUG : #07 pc 00075021 /system/lib/libandroid_runtime.so
05-21 10:18:51.616 463 463 F DEBUG : #08 pc 02287663 /system/framework/arm/boot.oat (offset 0x1fda000)
05-21 10:18:51.902 463 463 F DEBUG :
05-21 10:18:51.902 463 463 F DEBUG : Tombstone written to: /data/tombstones/tombstone_02
05-21 10:18:51.902 463 463 E DEBUG : AM write failed: Broken pipe
05-21 10:18:51.903 1769 1786 I BootReceiver: Copying /data/tombstones/tombstone_02 to DropBox (SYSTEM_TOMBSTONE)
05-21 10:18:51.952 485 485 I Zygote : Process 9188 exited due to signal (11)
05-21 10:18:51.966 1769 2757 I ActivityManager: Process com.example.workmanagercrash (pid 9188) has died
ap...@google.com <ap...@google.com> #30
Branch: androidx-master-dev
commit 957adb282e41c2662fff6221325e6b51cd7377f9
Author: Rahul Ravikumar <rahulrav@google.com>
Date: Tue May 21 14:37:00 2019
Fixes SQLite issues on some devices.
* Always beginTransaction() outside a try.
* Make sure SystemJobScheduler marks transactions as successful.
Test: Existing tests pass.
Fixes:
Change-Id: I55092537781fbfee97f4336eb7cf1a49e647d62a
M work/workmanager-gcm/src/main/java/androidx/work/impl/background/gcm/WorkManagerGcmDispatcher.java
M work/workmanager/src/main/java/androidx/work/impl/WorkerWrapper.java
M work/workmanager/src/main/java/androidx/work/impl/background/systemjob/SystemJobScheduler.java
M work/workmanager/src/main/java/androidx/work/impl/utils/ForceStopRunnable.java
Description