Skip to content

SamplesApp Android Debug head crashes on launch: R8 shrinks with no JNI keep rules #24943

Closed

Description

@MartinZikmund

Current behavior 🐛

A local Debug build of the SamplesApp Android head crashes on launch, because R8 has stripped AndroidX classes that only managed code reaches through JNI (androidx.core.splashscreen.SplashScreen, then androidx.activity.EdgeToEdge, …).

SamplesApp.csproj pins AndroidLinkTool=r8 for every configuration to avoid a d8 desugaring crash. In Debug, AndroidLinkMode is None, so the SDK never generates proguard_project_references.cfg, which holds the auto-generated keep rules for JNI-referenced types. The build warns about it:

warning XA4304: ProGuard configuration file ... was not found

As a result, R8 shrinks the app with no keep rules at all.

Expected behavior 🎯

The Debug Android head launches. R8 should only dex/desugar in Debug and not shrink.

How to reproduce it (as minimally and precisely as possible) 🔬

  1. dotnet build src/SamplesApp/SamplesApp/SamplesApp.csproj -f net10.0-android -c Debug -t:Install
  2. Launch the app on an emulator. It crashes with ClassNotFoundException for an AndroidX type.

Workaround 🛠️

Build with -p:DoNotSetAndroidLinkTool=true.

Renderer 🎨

  • Skia

Affected platforms 📱💻🖥️

Android

Uno.Sdk version (and other relevant versions) 📦

master (7.0)

IDE version 🧑‍💻

No response

Anything else we need to know? 💬

This only affects the repo's SamplesApp. Uno.Sdk does not pin AndroidLinkTool, so a Debug app built with it uses d8 and nothing is shrunk, and Release builds run the trimmer, which generates the keep rules.

A related packaging defect on the same head is tracked in #24520.

Activity

  1. self-assigned this
    on Oct 2, 2026
  2. added 8 commits that reference this issue on Oct 2, 2026
    d3659a1
    43cc176
    affd201
    43ee612
    11586aa
    7abe455
    0314aaa
    3e11028
  3. added
    platform/android 🤖
    and removed on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugplatform/android 🤖

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions