🌈 Create new beautiful Compose Gradients with our new wesite ->
Class

ComposeStackTraceMode

Defines how Compose runtime collects stack traces after a crash.

Source set: Common
public class ComposeStackTraceMode private constructor(private val value: Int)

Defines how Compose runtime collects stack traces after a crash. The stack trace mode is configured globally for all composition instances through androidx.compose.runtime.Composer.setDiagnosticStackTraceMode.

Members

Companion

Source set: Common
public companion object

Properties

None

Source set: Common
public val None: ComposeStackTraceMode

No stack trace information will be collected.

GroupKeys

Source set: Common
public val GroupKeys: ComposeStackTraceMode

Collects a stack trace with group keys. This stack trace can be deobfuscated with the proguard mapping that ships with the app (starting with Kotlin 2.3.0).

The group key stack traces are less precise than source information, but they do not add any runtime overhead until crash occurs and work with minified builds.

Example stack trace:

java.lang.IllegalStateException: <message>
at <original trace>
Suppressed: androidx.compose.runtime.ComposeTraceException:
Composition stack when thrown:
at $$compose.m$123(SourceFile:1)
at $$compose.m$234(SourceFile:1)
...

SourceInformation

Source set: Common
public val SourceInformation: ComposeStackTraceMode

Collects a stack trace based on source information embedded by Compose compiler. When this flag is enabled, composition will record source information at runtime. When crash occurs, Compose will append a suppressed exception that contains a stack trace pointing to the place in composition closest to the crash.

Note that:

    should NOT be enabled in release builds that are not optimized with R8 (or equivalent).

  • Recording source information introduces additional performance overhead, so this option
  • builds. Enabling this flag in minified builds will fallback in GroupKeys

  • Compose ships with a minifier config that removes source information from the release

Example stack trace:

java.lang.IllegalStateException: <message>
at <original trace>
Suppressed: androidx.compose.runtime.ComposeTraceException:
Composition stack when thrown:
at ReusableComposeNode(Composables.kt:359)
at Layout(Layout.kt:79)
at <lambda>(App.kt:164)
...

Auto

Source set: Common
public val Auto: ComposeStackTraceMode

GroupKeys when app is minified, or None otherwise.