Status Update
Comments
da...@google.com <da...@google.com> #2
Can you include a sample project that crashes in release mode?
go...@lutraha.com <go...@lutraha.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.
on...@adastra.one <on...@adastra.one> #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
...
a....@pri-num.com <a....@pri-num.com> #5
Thank you for sharing the sample project. I can confirm that I was able to reproduce the issue, and that
aq...@gmail.com <aq...@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.
da...@google.com <da...@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
ap...@google.com <ap...@google.com> #8
Could you please make an immediate patch release as 2.8.2 crashes with the above exception?
da...@google.com <da...@google.com>
an...@gmail.com <an...@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
da...@google.com <da...@google.com> #11
ap...@google.com <ap...@google.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>
na...@google.com <na...@google.com> #13
Seems to be good now. Thanks!
Description
Version used: room 2.7.0-beta01, sqlite 2.5.0-beta01
Devices/Android versions reproduced on: iPhone 16 Pro (18.2)
The issue happens during the compilation. The app compiles for Android target, but it fails to compile for iOS simulator.
> Task :xxx:kspKotlinIosSimulatorArm64 FAILED
note: [ksp] loaded provider(s): [androidx.room.RoomKspProcessor$Provider]
error: [ksp] java.lang.NullPointerException: null cannot be cast to non-null type androidx.room.compiler.processing.XAnnotation
at androidx.room.compiler.processing.XAnnotationValue.asAnnotation(XAnnotationValue.kt:62)
at androidx.room.compiler.processing.XAnnotationValue.asAnnotationList(XAnnotationValue.kt:68)
at androidx.room.processor.EntityProcessor$Companion.extractIndices(EntityProcessor.kt:42)
at androidx.room.processor.TableEntityProcessor.doProcess(TableEntityProcessor.kt:85)
at androidx.room.processor.TableEntityProcessor.process$lambda$0(TableEntityProcessor.kt:54)
at androidx.room.processor.cache.Cache$Bucket.get(Cache.kt:48)
at androidx.room.processor.TableEntityProcessor.process(TableEntityProcessor.kt:54)
at androidx.room.processor.DatabaseProcessor.processEntities(DatabaseProcessor.kt:442)
at androidx.room.processor.DatabaseProcessor.doProcess(DatabaseProcessor.kt:68)
at androidx.room.processor.DatabaseProcessor.process(DatabaseProcessor.kt:59)
at androidx.room.DatabaseProcessingStep.process$lambda$2$lambda$1(DatabaseProcessingStep.kt:69)
at androidx.room.processor.Context.collectLogs(Context.kt:178)
at androidx.room.DatabaseProcessingStep.process(DatabaseProcessingStep.kt:68)
at androidx.room.compiler.processing.CommonProcessorDelegate.processRound(XBasicAnnotationProcessor.kt:134)
at androidx.room.compiler.processing.ksp.KspBasicAnnotationProcessor.process(KspBasicAnnotationProcessor.kt:62)
at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:320)
at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:318)
at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.handleException(KotlinSymbolProcessingExtension.kt:430)
at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.doAnalysis(KotlinSymbolProcessingExtension.kt:318)
at org.jetbrains.kotlin.backend.konan.TopDownAnalyzerFacadeForKonan.analyzeFilesWithGivenTrace(TopDownAnalyzerFacadeForKonan.kt:102)
at org.jetbrains.kotlin.backend.konan.TopDownAnalyzerFacadeForKonan.analyzeFiles(TopDownAnalyzerFacadeForKonan.kt:65)
at org.jetbrains.kotlin.backend.konan.driver.phases.FrontendKt.FrontendPhase$lambda$3$lambda$2(Frontend.kt:67)
at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:112)
at org.jetbrains.kotlin.backend.konan.driver.phases.FrontendKt.FrontendPhase$lambda$3(Frontend.kt:66)
at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$createSimpleNamedCompilerPhase$1.phaseBody(PhaseBuilders.kt:69)
at org.jetbrains.kotlin.backend.common.phaser.SimpleNamedCompilerPhase.phaseBody(CompilerPhase.kt:226)
at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedCompilerPhase.invoke(CompilerPhase.kt:113)
at org.jetbrains.kotlin.backend.konan.driver.PhaseEngine.runPhase(Machinery.kt:120)
at org.jetbrains.kotlin.backend.konan.driver.PhaseEngine.runPhase$default(Machinery.kt:111)
at org.jetbrains.kotlin.backend.konan.driver.phases.TopLevelPhasesKt.runFrontend(TopLevelPhases.kt:32)
at org.jetbrains.kotlin.backend.konan.driver.DynamicCompilerDriver.serializeKlibK1(DynamicCompilerDriver.kt:152)
at org.jetbrains.kotlin.backend.konan.driver.DynamicCompilerDriver.produceKlib(DynamicCompilerDriver.kt:113)
at org.jetbrains.kotlin.backend.konan.driver.DynamicCompilerDriver.run$lambda$2$lambda$1$lambda$0(DynamicCompilerDriver.kt:44)
at org.jetbrains.kotlin.backend.konan.driver.PhaseEngine$Companion$startTopLevel$topLevelPhase$1.phaseBody(Machinery.kt:79)
at org.jetbrains.kotlin.backend.konan.driver.PhaseEngine$Companion$startTopLevel$topLevelPhase$1.phaseBody(Machinery.kt:73)
at org.jetbrains.kotlin.backend.common.phaser.SimpleNamedCompilerPhase.phaseBody(CompilerPhase.kt:226)
at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedCompilerPhase.invoke(CompilerPhase.kt:113)
at org.jetbrains.kotlin.backend.konan.driver.PhaseEngine$Companion.startTopLevel(Machinery.kt:86)
at org.jetbrains.kotlin.backend.konan.driver.DynamicCompilerDriver.run(DynamicCompilerDriver.kt:37)
at org.jetbrains.kotlin.backend.konan.KonanDriver.run(KonanDriver.kt:151)
at org.jetbrains.kotlin.cli.bc.K2Native.runKonanDriver(K2Native.kt:167)
at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:63)
at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:32)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:102)
at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.kt:316)
at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.kt:294)
at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.kt:258)
at org.jetbrains.kotlin.cli.common.CLICompiler$Companion.doMainNoExit(CLICompiler.kt:395)
at org.jetbrains.kotlin.cli.bc.K2Native$Companion.mainNoExitWithRenderer$lambda$2(K2Native.kt:217)
at org.jetbrains.kotlin.util.UtilKt.profileIf(Util.kt:22)
at org.jetbrains.kotlin.util.UtilKt.profile(Util.kt:16)
at org.jetbrains.kotlin.cli.bc.K2Native$Companion.mainNoExitWithRenderer(K2Native.kt:216)
at org.jetbrains.kotlin.cli.bc.K2NativeKt.mainNoExitWithXcodeRenderer(K2Native.kt:235)
at org.jetbrains.kotlin.cli.utilities.MainKt$daemonMainWithXcodeRenderer$1.invoke(main.kt:52)
at org.jetbrains.kotlin.cli.utilities.MainKt$daemonMainWithXcodeRenderer$1.invoke(main.kt:52)
at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:20)
at org.jetbrains.kotlin.cli.utilities.MainKt.inProcessMain(main.kt:57)
at org.jetbrains.kotlin.cli.utilities.MainKt.daemonMainWithXcodeRenderer(main.kt:52)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.jetbrains.kotlin.internal.compilerRunner.native.KotlinNativeToolRunner.runInProcess(KotlinNativeToolRunner.kt:151)
at org.jetbrains.kotlin.internal.compilerRunner.native.KotlinNativeToolRunner.runTool(KotlinNativeToolRunner.kt:52)
at org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile$compile$1.invoke(KotlinNativeTasks.kt:594)
at org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile$compile$1.invoke(KotlinNativeTasks.kt:578)
at org.jetbrains.kotlin.compilerRunner.ReportUtilsKt.addBuildMetricsForTaskAction(reportUtils.kt:259)