ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in .../build/app/outputs/mapping/.../.txt.

Khalid Aziz 25 Reputation points
2025-05-14T06:39:21.96+00:00

Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated

Azure Advisor
Azure Advisor
An Azure personalized recommendation engine that helps users follow best practices to optimize Azure deployments.
146 questions
{count} vote

Accepted answer
  1. Michele Ariis 1,960 Reputation points MVP
    2025-05-14T08:41:22.2566667+00:00

    -Open the R8 report.

    You can find it at: app/build/outputs/mapping/<flavorRelease>/missing_rules.txt.

    Inside, you’ll see a detailed list of missing classes or suggested -keep / -dontwarn rules.

    Fix the issue using one (ideally both) of these methods:

    Add the missing libraries in your build.gradle file (e.g., Conscrypt, SLF4J, etc.).

    Copy the recommended rules from the report into your proguard-rules.pro (or consumer-rules.pro if you're publishing a library).

    Then, rebuild the project using ./gradlew clean assembleRelease or your Azure DevOps pipeline.

    If new missing classes are detected, the report will be regenerated. Repeat this process until the build passes.

    Avoid shortcuts.

    Options like -ignorewarnings or android.r8.failOnMissingClasses=false only work with AGP ≤ 7.x and reduce security.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.