Performance & Crash Debugging

Android ClassNotFoundException: Check Packaging, Loading and Shrinking

ClassNotFoundException means a loader could not find a requested class by name. The class may be missing from the artifact, renamed or removed by shrinking, loaded before a feature is installed, or requested through the wrong name or loader.

By Updated 2 min read

Identify how the class is loaded

A direct source reference, reflection, framework component declaration and native callback have different failure paths. Preserve the class name and the first application frame that requested it.

Use the dependency guide to establish whether the defining library entered the affected runtime configuration.

Inspect the release artifact

Finding Next investigation
Class absent Dependency scope, build variant or shrinking
Renamed class Reflection contract and keep rules
Class in an uninstalled feature Feature delivery and load ordering
Class present under another name Package or generated-code mismatch

The R8 keep-rule guide explains retaining dynamic entry points. A keep rule cannot add a dependency that was never packaged.

Treat multidex according to platform support

For older supported Android versions, multidex setup may affect class availability during startup. Do not add legacy multidex initialization indiscriminately to every modern project without checking its minimum SDK and build configuration.

Avoid broad workarounds

Keeping all classes or copying a random JAR can hide the original dependency mistake and introduce duplicate classes. Correct the specific packaging or loading contract.

Test the optimized release rather than relying only on debug behavior, especially when reflection is involved.

Validate the actual entry path

APKLint's DEX and package tools can help inspect packaged structure, and its crash analyzer can interpret the trace. They cannot prove that a dynamic feature was installed on the failing device. Reproduce the same class-loading path, distribution state and variant before marking the issue resolved.

Sources and further reading

  1. Android Developers: Enable multidex
  2. Android Developers: Add keep rules
  3. Android Developers: Add build dependencies

Reference review: 22 September 2026. Examples illustrate the workflow; check your installed versions, release artifact and account-specific Console requirements before applying them. This guide is not a claim that APKLint executed your project or verified your private account.

APKLint

Android inspection tools and practical release guides. About APKLint · Report a correction