Jetpack Compose Integration

This guide provides instructions on how to integrate Luciq's Bug Reporting, Crash Reporting, and App Performance Monitoring features into your Jetpack Compose application. Following these steps, you can capture and report bugs and crashes from your Compose UI.

Integration Methods

There are two ways to integrate Jetpack Compose with Luciq:

  • Automatic Approach - We detect the screens if you are using the Compose Navigation library.

  • Manual Approach - You define each screen using an API.

Common Integration Steps

For both the manual and automatic approach, you must use these common integration steps:

For Bug Reporting & Crash Reporting only

implementation "androidx.compose.ui:ui:$compose_version" 
implementation "ai.luciq.library:luciq-compose:x.x.x"

For Bug Reporting, Crash Reporting, & APM

implementation "androidx.compose.ui:ui:$compose_version" 
implementation "androidx.compose.foundation:foundation:$compose_version" 
implementation "ai.luciq.library:luciq-compose-apm:x.x.x"
circle-info

Minimum & Maximum Compose UI and Foundation versions

The minimum supported compose.ui and compose.foundation version is 1.1.0, and the maximum supported version is 1.5.0 for SDKs below 13.0.0. Starting from SDK version 13.0.0 the minimum supported compose.ui and compose foundation versions 1.5.0.

triangle-exclamation
circle-exclamation

For APM:

Automatic Approach

circle-info

For projects using pluginManagement

If your project uses pluginManagement in settings.gradle.kts (default for new Android projects), configure repositories there:

settings.gradle.kts:

Then in your project-level build.gradle.kts, use the plugins block:

circle-info

Please note that the Automatic Approach only works if you are using the Compose Navigation library.

If you are using Compose Navigation, you can capture Compose View Names, User Interactions and their performance out-of-the-box without any code change. You will just need to add these configurations to your Gradle - build.gradle file:

To enrich the data captured in user Interactions (User Steps and Repro steps), please apply Luciq's compiler extension plugin In app build.grade and configure the compatible extension version to the Kotlin version used:

Configuration Block

You can configure the compiler extension as follows:

circle-check

Minimum & Maximum Compose Navigation versions

Manual Approach

Define Screen Names

In order to track and identify screens in your Compose app, you‘ll need to define screen names using the LuciqScreen function. The screen name will correspond to the current view in your app, and Luciq will use the latest UI component to update screens. This wrapper also controls how your composable appears inside APM.

Example usage of LuciqScreen in a Compose UI:

  • screenName: This represents the name your compose screen will have on the dashboard. Make sure to use unique screen names for each screen in your app.

  • showAsScreen: This is an optional configuration that controls how your composable will appear inside Screen Loadingarrow-up-right in APMarrow-up-right.

    • false: This composable loading time will be tracked as a span inside it’s parent activity or composable. This is the default behavior if the configuration is not used.

    • true: This composable will appear as it’s own screen and will have all the details associated with screen loading (e.g. Apdex, P50, P90 ,Spans, etc.)

circle-exclamation

Nesting wrappers can cause duplicate data to be recorded

circle-exclamation

Private Views

You can easily mark any composable view that might contain sensitive information, i.e.; payment details, as private. Any private view will automatically appear with a black overlay covering it in any screenshot.

To mark any composable as private, you just have to add the luciqPrivate() Modifier extension to the Composable’s list modifier.

Example

This will mask the content of any composable in screenshot, repro steps, etc …

Jetpack Compose Support

We currently support the following products:

  • Bug Reports

  • Crashes

  • User Steps that happened inside a Compose View

  • Repro steps (including interactions) that happened inside a Compose View

  • Private views in JPC

  • App launches and screen loading Compose view performance

  • Network calls that happen on a Compose view

circle-check

Minimum SDK Version

Last updated