Play Console’s ‘deprecated APIs for edge-to-edge’ warning pointed at androidx.activity’s own enableEdgeToEdge(), and no keep rule removes it

The Play Console flagged my first production release with « Your app uses deprecated APIs or parameters for edge-to-edge » and listed android.view.Window.setStatusBarColor, setNavigationBarColor and LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES at five locations: it0.b, jt0.b, lt0.b, ot0.b, k1.t. My code never touches the window. Every one of those names resolved to a class inside androidx.activity, the library whose enableEdgeToEdge() the same Console page tells you to call.

TL;DR — De-obfuscate the Console’s locations with the mapping.txt of the same build before changing anything. On an app whose own code never sets bar colours, they resolve to androidx.activity.EdgeToEdgeApi23/26/28/29/35: the deprecated calls live inside enableEdgeToEdge() itself and ship in every APK because the implementation is picked at runtime by SDK_INT. No ProGuard rule and no app change removes the warning while you use that API. Note it and move on.

The setup

A Jetpack Compose app, targetSdk 36, release build shrunk by R8 in full mode. The single activity calls enableEdgeToEdge() from androidx.activity 1.13.0 first thing in onCreate, then applies window insets through the Compose scaffold. That is the setup Google documents for Android 15, where edge-to-edge is enforced and the old setStatusBarColor family is deprecated.

The Console’s analysis reports obfuscated names, because it reads the shrunk dex, not the source. R8 writes the correspondence in app/build/outputs/mapping/release/mapping.txt at build time; the file that matters is the one from the exact build you uploaded.

What I expected

Some leftover of mine: a full-screen photo viewer, a « max brightness » toggle on the barcode screen, anything that reaches for window.attributes. I expected to find a call to fix or a flag to drop.

What actually happens

Mapping the four *t0 classes is a one-liner over mapping.txt, whose class lines look like original.Name -> obfuscated:.

import re
mp = {}
for line in open("app/build/outputs/mapping/release/mapping.txt"):
    m = re.match(r"^(\S+) -> (\S+):$", line)
    if m:
        mp[m.group(2)] = m.group(1)
for name in ["it0", "jt0", "lt0", "ot0", "k1"]:
    print(name, "<-", mp.get(name))
it0 <- androidx.activity.EdgeToEdgeApi23
jt0 <- androidx.activity.EdgeToEdgeApi26
lt0 <- androidx.activity.EdgeToEdgeApi29
ot0 <- androidx.activity.EdgeToEdgeApi35
k1  <- androidx.core.view.accessibility.AccessibilityNodeInfoCompat$$ExternalSyntheticApiModelOutline0

Four of five are the per-API implementations behind enableEdgeToEdge(). Even the API 35 one still calls setStatusBarColor in version 1.13.0. The fifth is stranger: k1 is one of R8’s API outlining holders. When code calls an API above minSdk, R8 moves the call into a synthetic method so older devices never verify it, and it attaches that synthetic class to an arbitrary existing class name. Here the holder is named after an accessibility class that has nothing to do with the cutout constant. The mapping alone cannot say who calls k1.t, so I asked the dex:

unzip -o -q app-release.apk 'classes*.dex' -d dex
$ANDROID_HOME/build-tools/34.0.0/dexdump -d dex/classes.dex \
  | grep -B 40 'Lk1;.t:' | grep -E '\(in L|Lk1;.t:'

The class that invokes Lk1;.t was Lkt0;, which the mapping resolves to androidx.activity.EdgeToEdgeApi28, the implementation that sets LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES on API 28. The same lookup on setStatusBarColor, keeping only invoke lines, returned exactly the four EdgeToEdgeApi* classes and nothing from my package.

The Console's five obfuscated locations, resolved through mapping.txt and one dexdump lookup, all land inside androidx.activity's EdgeToEdge implementations, none in the app's own package.

The fix

There is none to make in the app. The library selects one EdgeToEdgeApiNN at runtime, but every variant is in the dex, and the Console’s scan is static. Dropping enableEdgeToEdge() would trade this warning for the more serious one, « edge-to-edge may not display for all users ». I left a comment in proguard-rules.pro next to the rule that fixes that one, so nobody on the project chases the deprecated-API note again:

# Play Console "deprecated APIs for edge-to-edge": setStatusBarColor and friends are
# called by androidx.activity.EdgeToEdgeApi23/26/28/29/35, not by this app (checked
# with mapping.txt + dexdump on 1.5.1). Nothing to fix while enableEdgeToEdge() is used.
-keep class androidx.activity.EdgeToEdge { public static void enable(...); }

The keep rule itself is a separate story: R8 inlines enableEdgeToEdge and the Console then claims the app does not support edge-to-edge.

Why it works

enableEdgeToEdge() has to keep older devices looking right, and on Android 10 to 14 the only way to paint a scrim behind the bars is setStatusBarColor. Those calls are deprecated on Android 15, where they are no-ops, but they are still the correct API on the versions that execute them. The Console’s checker is a dex scan with no notion of the SDK_INT branch, so it reports the library’s fallbacks as if they were yours. The mapping file turns a scary list into a five-minute attribution; the dexdump step covers the case the mapping cannot, an outlined call whose holder class carries an unrelated name.

What I did not test

Only androidx.activity 1.13.0 and a Compose app. I did not try the 1.14.0 alpha to see whether its API 35 path drops setStatusBarColor; the older implementations would still be in the dex either way. I have not checked whether the Console ever stops reporting this for apps that keep enableEdgeToEdge(), and I did not measure whether the warning affects anything beyond the « recommended actions » list.

Facts

context: Compose app, targetSdk 36, R8 full mode, activity calls androidx.activity enableEdgeToEdge()
problem: Play Console "deprecated APIs for edge-to-edge" lists setStatusBarColor / setNavigationBarColor / LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES at obfuscated locations
solution: resolve them with the build's mapping.txt (and dexdump for R8 API-outline holders); they are androidx.activity.EdgeToEdgeApi23-35, so there is nothing to change in the app
verified_on: 2026-09-05
applies_to: [androidx.activity 1.13.0, R8 full mode, Android Gradle Plugin 9.x]
does_not_apply_to: [apps that set window bar colours themselves, androidx.activity 1.14 alpha (untested)]

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Retour en haut