For the complete documentation index, see llms.txt. This page is also available as Markdown.

Preserving Screen Names

Keep your original Activity and Fragment screen names readable on the Luciq dashboard when your Android app is built with a class-renaming obfuscator.

If your dashboard shows screen names like zqx.a or b.c.d instead of CheckoutActivity or ProfileFragment, your build is renaming those classes before they ship. Luciq identifies a screen by its runtime class name, so once the class is renamed, every product that reports a screen name reports the renamed one.

Luciq's Gradle plugin can bake the original class name into each Activity and Fragment at build time, so the readable name survives obfuscation. You turn it on with a single flag:

luciq {
    keepScreenNames = true
}

Why Your Screen Names Look Obfuscated

A screen's identity in the SDK is its runtime class name, and what happens to that name depends on which tool minifies your app.

  • AGP with plain R8. Activities survive, because AGP generates keep rules for them from your AndroidManifest.xml. Fragments are not referenced in the manifest, so plain R8 renames them in every minified app.

  • Commercial obfuscators such as DexGuard or Appdome. These replace R8, rewrite the manifest to match the new names, and can therefore rename Activities as well as Fragments.

On top of being unreadable, obfuscated names are unstable: obfuscators re-randomise them on every release, so the same screen produces a different name in each build and your metric groups fragment release after release.

Uploading Mapping Files Does Not Fix Screen Names

Enabling keepScreenNames

keepScreenNames is available starting from SDK version 19.13.0. It is false by default, so apps that do not set it keep their current behavior.

Step 1: Add the Plugin to your buildscript

This is the same plugin artifact already used for mapping file upload and Fragment spans. If it is already in your buildscript, skip this step.

Step 2: Apply the plugin in your app module

Add apply plugin: 'luciq' to your app's Gradle file.

keepScreenNames Only Works Under the luciq Plugin ID

Step 3: Configure the plugin

Build a release variant with your obfuscator in place, and the screens reported by the SDK carry their original names.

Do Not Add a Keep Rule for Your Screens

What It Affects

With keepScreenNames enabled, readable screen names appear across every Luciq product that reports a screen:

  • APM: UI traces, Screen Loading, App Launch and Fragment spans.

  • Crash Reporting and ANRs: the current view / Activity name shown on the report.

  • Repro Steps and user steps: the screen name on each step, including taps, swipes and scrolls.

  • Session Replay: the screen names shown in the replay timeline.

  • Bug Reporting: the reported current view.

How It Works

Before R8 or your obfuscator runs, the Gradle plugin's ASM transform gives every Activity and Fragment subclass a marker interface and a generated method whose entire body returns the original fully qualified class name as a string literal. Obfuscators rename symbols, but they never rewrite string literals, so the baked-in name survives renaming and the SDK reads it at runtime instead of the renamed class name.

Last updated