---
title: "ComposeStackTraceMode"
description: "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]."
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
public value 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`.


## Companion Object

#### Properties

<div class='sourceset sourceset-common'>Common</div>


```kotlin
public val None: ComposeStackTraceMode
```


No stack trace information will be collected.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
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)   ...
```



<div class='sourceset sourceset-common'>Common</div>


```kotlin
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:
- Recording source information introduces additional performance overhead, so this option should NOT be enabled in release builds that are not optimized with R8 (or equivalent).
- Compose ships with a minifier config that removes source information from the release builds. Enabling this flag in minified builds will fallback in `GroupKeys`

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)   ...
```



<div class='sourceset sourceset-common'>Common</div>


```kotlin
public val Auto: ComposeStackTraceMode
```


`GroupKeys` when app is minified, or `None` otherwise.





